public FSRevisionNode getChildDirNode(String childName, FSFS fsfsOwner) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to open node with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = getDirEntries(fsfsOwner); FSEntry entry = entries != null ? (FSEntry) entries.get(childName) : null; if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Attempted to open non-existent child node ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } return fsfsOwner.getRevisionNode(entry.getId()); }
public FSRevisionNode getChildDirNode(String childName, FSFS fsfsOwner) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to open node with an illegal name ''{0}''", childName); SVNErrorManager.error(err); } Map entries = getDirEntries(fsfsOwner); FSEntry entry = entries != null ? (FSEntry) entries.get(childName) : null; if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Attempted to open non-existent child node ''{0}''", childName); SVNErrorManager.error(err); } return fsfsOwner.getRevisionNode(entry.getId()); }
public FSRevisionNode getChildDirNode(String childName, FSFS fsfsOwner) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to open node with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = getDirEntries(fsfsOwner); FSEntry entry = entries != null ? (FSEntry) entries.get(childName) : null; if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Attempted to open non-existent child node ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } return fsfsOwner.getRevisionNode(entry.getId()); }
public FSRevisionNode getChildDirNode(String childName, FSFS fsfsOwner) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to open node with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = getDirEntries(fsfsOwner); FSEntry entry = entries != null ? (FSEntry) entries.get(childName) : null; if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FOUND, "Attempted to open non-existent child node ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } return fsfsOwner.getRevisionNode(entry.getId()); }
public void deleteEntry(FSRevisionNode parent, String entryName) throws SVNException { if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to delete entry ''{0}'' from *non*-directory node", entryName); SVNErrorManager.error(err); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to delete entry ''{0}'' from immutable directory node", entryName); SVNErrorManager.error(err); } if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to delete a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err); } Map entries = parent.getDirEntries(getOwner()); FSEntry dirEntry = (FSEntry) entries.get(entryName); if (dirEntry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_ENTRY, "Delete failed--directory has no entry ''{0}''", entryName); SVNErrorManager.error(err); } getOwner().getRevisionNode(dirEntry.getId()); deleteEntryIfMutable(dirEntry.getId()); setEntry(parent, entryName, null, SVNNodeKind.UNKNOWN); }
public void deleteEntry(FSRevisionNode parent, String entryName) throws SVNException { if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to delete entry ''{0}'' from *non*-directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to delete entry ''{0}'' from immutable directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to delete a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = parent.getDirEntries(getOwner()); FSEntry dirEntry = (FSEntry) entries.get(entryName); if (dirEntry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_ENTRY, "Delete failed--directory has no entry ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } getOwner().getRevisionNode(dirEntry.getId()); deleteEntryIfMutable(dirEntry.getId()); setEntry(parent, entryName, null, SVNNodeKind.UNKNOWN); }
public void deleteEntry(FSRevisionNode parent, String entryName) throws SVNException { if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to delete entry ''{0}'' from *non*-directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to delete entry ''{0}'' from immutable directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to delete a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = parent.getDirEntries(getOwner()); FSEntry dirEntry = (FSEntry) entries.get(entryName); if (dirEntry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_ENTRY, "Delete failed--directory has no entry ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } getOwner().getRevisionNode(dirEntry.getId()); deleteEntryIfMutable(dirEntry.getId()); setEntry(parent, entryName, null, SVNNodeKind.UNKNOWN); }
public void deleteEntry(FSRevisionNode parent, String entryName) throws SVNException { if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to delete entry ''{0}'' from *non*-directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to delete entry ''{0}'' from immutable directory node", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to delete a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } Map entries = parent.getDirEntries(getOwner()); FSEntry dirEntry = (FSEntry) entries.get(entryName); if (dirEntry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_SUCH_ENTRY, "Delete failed--directory has no entry ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } getOwner().getRevisionNode(dirEntry.getId()); deleteEntryIfMutable(dirEntry.getId()); setEntry(parent, entryName, null, SVNNodeKind.UNKNOWN); }
public FSRevisionNode makeEntry(FSRevisionNode parent, String parentPath, String entryName, boolean isDir, String txnId) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to create a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err); } if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to create entry in non-directory parent"); SVNErrorManager.error(err); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err); } FSRevisionNode newRevNode = new FSRevisionNode(); newRevNode.setType(isDir ? SVNNodeKind.DIR : SVNNodeKind.FILE); newRevNode.setCreatedPath(SVNPathUtil.concatToAbs(parentPath, entryName)); newRevNode.setCopyRootPath(parent.getCopyRootPath()); newRevNode.setCopyRootRevision(parent.getCopyRootRevision()); newRevNode.setCopyFromRevision(FSRepository.SVN_INVALID_REVNUM); newRevNode.setCopyFromPath(null); FSID newNodeId = createNode(newRevNode, parent.getId().getCopyID(), txnId); FSRevisionNode childNode = myFSFS.getRevisionNode(newNodeId); myTxnRoot.setEntry(parent, entryName, childNode.getId(), newRevNode.getType()); return childNode; }
public FSRevisionNode makeEntry(FSRevisionNode parent, String parentPath, String entryName, boolean isDir, String txnId) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to create a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to create entry in non-directory parent"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode newRevNode = new FSRevisionNode(); newRevNode.setType(isDir ? SVNNodeKind.DIR : SVNNodeKind.FILE); String createdPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, entryName)); newRevNode.setCreatedPath(createdPath); newRevNode.setCopyRootPath(parent.getCopyRootPath()); newRevNode.setCopyRootRevision(parent.getCopyRootRevision()); newRevNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); newRevNode.setCopyFromPath(null); FSID newNodeId = createNode(newRevNode, parent.getId().getCopyID(), txnId); FSRevisionNode childNode = myFSFS.getRevisionNode(newNodeId); myTxnRoot.setEntry(parent, entryName, childNode.getId(), newRevNode.getType()); return childNode; }
public FSRevisionNode makeEntry(FSRevisionNode parent, String parentPath, String entryName, boolean isDir, String txnId) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to create a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to create entry in non-directory parent"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode newRevNode = new FSRevisionNode(); newRevNode.setType(isDir ? SVNNodeKind.DIR : SVNNodeKind.FILE); String createdPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, entryName)); newRevNode.setCreatedPath(createdPath); newRevNode.setCopyRootPath(parent.getCopyRootPath()); newRevNode.setCopyRootRevision(parent.getCopyRootRevision()); newRevNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); newRevNode.setCopyFromPath(null); FSID newNodeId = createNode(newRevNode, parent.getId().getCopyID(), txnId); FSRevisionNode childNode = myFSFS.getRevisionNode(newNodeId); myTxnRoot.setEntry(parent, entryName, childNode.getId(), newRevNode.getType()); return childNode; }
public FSRevisionNode makeEntry(FSRevisionNode parent, String parentPath, String entryName, boolean isDir, String txnId) throws SVNException { if (!SVNPathUtil.isSinglePathComponent(entryName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to create a node with an illegal name ''{0}''", entryName); SVNErrorManager.error(err, SVNLogType.FSFS); } if (parent.getType() != SVNNodeKind.DIR) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Attempted to create entry in non-directory parent"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode newRevNode = new FSRevisionNode(); newRevNode.setType(isDir ? SVNNodeKind.DIR : SVNNodeKind.FILE); String createdPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, entryName)); newRevNode.setCreatedPath(createdPath); newRevNode.setCopyRootPath(parent.getCopyRootPath()); newRevNode.setCopyRootRevision(parent.getCopyRootRevision()); newRevNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); newRevNode.setCopyFromPath(null); FSID newNodeId = createNode(newRevNode, parent.getId().getCopyID(), txnId); FSRevisionNode childNode = myFSFS.getRevisionNode(newNodeId); FSTransactionRoot txnRoot = getTxnRoot(); txnRoot.setEntry(parent, entryName, childNode.getId(), newRevNode.getType()); return childNode; }
public FSRevisionNode cloneChild(FSRevisionNode parent, String parentPath, String childName, String copyId, boolean isParentCopyRoot) throws SVNException { if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err); } if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to make a child clone with an illegal name ''{0}''", childName); SVNErrorManager.error(err); } FSRevisionNode childNode = parent.getChildDirNode(childName, getOwner()); FSID newNodeId = null; if (childNode.getId().isTxn()) { newNodeId = childNode.getId(); } else { if (isParentCopyRoot) { childNode.setCopyRootPath(parent.getCopyRootPath()); childNode.setCopyRootRevision(parent.getCopyRootRevision()); } childNode.setCopyFromPath(null); childNode.setCopyFromRevision(FSRepository.SVN_INVALID_REVNUM); childNode.setPredecessorId(childNode.getId()); if (childNode.getCount() != -1) { childNode.setCount(childNode.getCount() + 1); } childNode.setCreatedPath(SVNPathUtil.concatToAbs(parentPath, childName)); newNodeId = createSuccessor(childNode.getId(), childNode, copyId); setEntry(parent, childName, newNodeId, childNode.getType()); } return getOwner().getRevisionNode(newNodeId); }
public FSRevisionNode cloneChild(FSRevisionNode parent, String parentPath, String childName, String copyId, boolean isParentCopyRoot) throws SVNException { if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to make a child clone with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode childNode = parent.getChildDirNode(childName, getOwner()); FSID newNodeId = null; if (childNode.getId().isTxn()) { newNodeId = childNode.getId(); } else { if (isParentCopyRoot) { childNode.setCopyRootPath(parent.getCopyRootPath()); childNode.setCopyRootRevision(parent.getCopyRootRevision()); } childNode.setCopyFromPath(null); childNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); childNode.setPredecessorId(childNode.getId()); if (childNode.getCount() != -1) { childNode.setCount(childNode.getCount() + 1); } childNode.setCreatedPath(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, childName))); newNodeId = createSuccessor(childNode.getId(), childNode, copyId); setEntry(parent, childName, newNodeId, childNode.getType()); } return getOwner().getRevisionNode(newNodeId); }
public FSRevisionNode cloneChild(FSRevisionNode parent, String parentPath, String childName, String copyId, boolean isParentCopyRoot) throws SVNException { if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to make a child clone with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode childNode = parent.getChildDirNode(childName, getOwner()); FSID newNodeId = null; if (childNode.getId().isTxn()) { newNodeId = childNode.getId(); } else { if (isParentCopyRoot) { childNode.setCopyRootPath(parent.getCopyRootPath()); childNode.setCopyRootRevision(parent.getCopyRootRevision()); } childNode.setCopyFromPath(null); childNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); childNode.setPredecessorId(childNode.getId()); if (childNode.getCount() != -1) { childNode.setCount(childNode.getCount() + 1); } childNode.setCreatedPath(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, childName))); newNodeId = createSuccessor(childNode.getId(), childNode, copyId); setEntry(parent, childName, newNodeId, childNode.getType()); } return getOwner().getRevisionNode(newNodeId); }
public FSRevisionNode cloneChild(FSRevisionNode parent, String parentPath, String childName, String copyId, boolean isParentCopyRoot) throws SVNException { if (!parent.getId().isTxn()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_MUTABLE, "Attempted to clone child of non-mutable node"); SVNErrorManager.error(err, SVNLogType.FSFS); } if (!SVNPathUtil.isSinglePathComponent(childName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_SINGLE_PATH_COMPONENT, "Attempted to make a child clone with an illegal name ''{0}''", childName); SVNErrorManager.error(err, SVNLogType.FSFS); } FSRevisionNode childNode = parent.getChildDirNode(childName, getOwner()); FSID newNodeId = null; if (childNode.getId().isTxn()) { newNodeId = childNode.getId(); } else { if (isParentCopyRoot) { childNode.setCopyRootPath(parent.getCopyRootPath()); childNode.setCopyRootRevision(parent.getCopyRootRevision()); } childNode.setCopyFromPath(null); childNode.setCopyFromRevision(SVNRepository.INVALID_REVISION); childNode.setPredecessorId(childNode.getId()); if (childNode.getCount() != -1) { childNode.setCount(childNode.getCount() + 1); } childNode.setCreatedPath(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(parentPath, childName))); newNodeId = createSuccessor(childNode.getId(), childNode, copyId); setEntry(parent, childName, newNodeId, childNode.getType()); } return getOwner().getRevisionNode(newNodeId); }