public void makeDir(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); String txnId = myTxnRoot.getTxnID(); FSParentPath parentPath = myTxnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(myTxnRoot, path, myFSFS), SVNLogType.FSFS); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, true, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode subDirNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getEntryName(), true, txnId); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), subDirNode); addChange(path, subDirNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, SVNRepository.INVALID_REVISION, null, SVNNodeKind.DIR); }
public String getAbsPath() throws SVNException { String pathSoFar = "/"; if (myParent != null) { pathSoFar = myParent.getAbsPath(); } return getNameEntry() != null ? SVNPathUtil.concatToAbs(pathSoFar, getNameEntry()) : pathSoFar; }
public String getRelativePath(FSParentPath ancestor) { String pathSoFar = ""; FSParentPath thisNode = this; while (thisNode != ancestor) { pathSoFar = SVNPathUtil.append(thisNode.getEntryName(), pathSoFar); thisNode = thisNode.getParent(); } return pathSoFar; }
public void incrementMergeInfoUpTree(FSParentPath parentPath, long increment) throws SVNException { while (parentPath != null) { myTxnRoot.incrementMergeInfoCount(parentPath.getRevNode(), increment); parentPath = parentPath.getParent(); } }
if (parentPath.getRevNode().getId().isTxn()) { return; if (parentPath.getParent() != null) { makePathMutable(parentPath.getParent(), errorPath); FSID parentId = null; String copyId = null; switch (parentPath.getCopyStyle()) { case FSCopyInheritance.COPY_ID_INHERIT_PARENT: parentId = parentPath.getParent().getRevNode().getId(); copyId = parentId.getCopyID(); break; String copyRootPath = parentPath.getRevNode().getCopyRootPath(); long copyRootRevision = parentPath.getRevNode().getCopyRootRevision(); FSID childId = parentPath.getRevNode().getId(); FSID copyRootId = copyRootNode.getId(); boolean isParentCopyRoot = false; String clonePath = parentPath.getParent().getAbsPath(); clone = myTxnRoot.cloneChild(parentPath.getParent().getRevNode(), clonePath, parentPath.getEntryName(), copyId, isParentCopyRoot); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), clone); } else { FSTransactionInfo txn = myTxnRoot.getTxn(); parentPath.setRevNode(clone);
String pathSoFar = "/"; FSParentPath parentPath = new FSParentPath(here, null, null); parentPath.setCopyStyle(FSCopyInheritance.COPY_ID_INHERIT_SELF); if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) { if (!lastEntryMustExist && (next == null || "".equals(next))) { return new FSParentPath(null, entry, parentPath); parentPath.setParentPath(child, entry, storeParents ? new FSParentPath(parentPath) : null); parentPath.setCopyStyle(copyInheritance.getStyle()); parentPath.setCopySourcePath(copyInheritance.getCopySourcePath());
public void deleteNode(String path) throws SVNException { FSParentPath parentPath = myTxnRoot.openPath(path, true, true); if (parentPath.getParent() == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_ROOT_DIR, "The root directory cannot be deleted"); SVNErrorManager.error(err); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, true, false); } makePathMutable(parentPath.getParent(), path); myTxnRoot.deleteEntry(parentPath.getParent().getRevNode(), parentPath.getNameEntry()); myTxnRoot.removeRevNodeFromCache(parentPath.getAbsPath()); addChange(path, parentPath.getRevNode().getId(), FSPathChangeKind.FS_PATH_CHANGE_DELETE, false, false, FSRepository.SVN_INVALID_REVNUM, null); }
path = SVNPathUtil.canonicalizeAbsolutePath(path); FSParentPath parentPath = revRoot.openPath(path, true, true); if (inherit == SVNMergeInfoInheritance.NEAREST_ANCESTOR && parentPath.getParent() == null) { return mergeInfo; nearestAncestor = parentPath.getParent(); } else { nearestAncestor = parentPath; boolean hasMergeInfo = nearestAncestor.getRevNode().hasMergeInfo(); if (hasMergeInfo) { break; nearestAncestor = nearestAncestor.getParent(); if (nearestAncestor == null) { return mergeInfo; SVNProperties propList = nearestAncestor.getRevNode().getProperties(fsfs); String mergeInfoString = propList.getStringValue(SVNProperty.MERGE_INFO); if (mergeInfoString == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Node-revision ''{0}@{1}'' claims to have mergeinfo but doesn''t", new Object[] { nearestAncestor.getAbsPath(), new Long(revRoot.getRevision()) }); SVNErrorManager.error(err, SVNLogType.FSFS); tmpMergeInfo = SVNMergeInfoUtil.getInheritableMergeInfo(tmpMergeInfo, null, SVNRepository.INVALID_REVISION, SVNRepository.INVALID_REVISION); mergeInfo = appendToMergedFroms(tmpMergeInfo, parentPath.getRelativePath(nearestAncestor)); return mergeInfo;
public FSCopyInheritance getCopyInheritance(FSParentPath child) throws SVNException { if (child == null || child.getParent() == null || myTxnID == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error: invalid txn name or child"); SVNErrorManager.error(err); FSID childID = child.getRevNode().getId(); FSID parentID = child.getParent().getRevNode().getId(); String childCopyID = childID.getCopyID(); String parentCopyID = parentID.getCopyID(); long copyrootRevision = child.getRevNode().getCopyRootRevision(); String copyrootPath = child.getRevNode().getCopyRootPath(); String idPath = child.getRevNode().getCreatedPath(); if (idPath.compareTo(child.getAbsPath()) == 0) { copyInheritance.setStyle(FSCopyInheritance.COPY_ID_INHERIT_SELF); return copyInheritance;
if (parentPath.getRevNode().getId().isTxn()) { return; if (parentPath.getParent() != null) { makePathMutable(parentPath.getParent(), errorPath); FSID parentId = null; String copyId = null; switch (parentPath.getCopyStyle()) { case FSCopyInheritance.COPY_ID_INHERIT_PARENT: parentId = parentPath.getParent().getRevNode().getId(); copyId = parentId.getCopyID(); break; String copyRootPath = parentPath.getRevNode().getCopyRootPath(); long copyRootRevision = parentPath.getRevNode().getCopyRootRevision(); FSID childId = parentPath.getRevNode().getId(); FSID copyRootId = copyRootNode.getId(); boolean isParentCopyRoot = false; String clonePath = parentPath.getParent().getAbsPath(); clone = myTxnRoot.cloneChild(parentPath.getParent().getRevNode(), clonePath, parentPath.getNameEntry(), copyId, isParentCopyRoot); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), clone); } else { FSTransactionInfo txn = myTxnRoot.getTxn(); parentPath.setRevNode(clone);
public FSRevisionNode getRevisionNode(String path) throws SVNException { String canonPath = path; FSRevisionNode node = fetchRevNodeFromCache(canonPath); if (node == null) { FSParentPath parentPath = openPath(path, true, false); node = parentPath.getRevNode(); } return node; }
public String getAbsPath() throws SVNException { String pathSoFar = "/"; if (myParent != null) { pathSoFar = myParent.getAbsPath(); } return SVNPathUtil.getAbsolutePath(SVNPathUtil.append(pathSoFar, getEntryName())); }
if (parentPath.getRevNode().getId().isTxn()) { return; if (parentPath.getParent() != null) { makePathMutable(parentPath.getParent(), errorPath); FSID parentId = null; String copyId = null; switch (parentPath.getCopyStyle()) { case FSCopyInheritance.COPY_ID_INHERIT_PARENT: parentId = parentPath.getParent().getRevNode().getId(); copyId = parentId.getCopyID(); break; String copyRootPath = parentPath.getRevNode().getCopyRootPath(); long copyRootRevision = parentPath.getRevNode().getCopyRootRevision(); FSID childId = parentPath.getRevNode().getId(); FSID copyRootId = copyRootNode.getId(); boolean isParentCopyRoot = false; String clonePath = parentPath.getParent().getAbsPath(); clone = myTxnRoot.cloneChild(parentPath.getParent().getRevNode(), clonePath, parentPath.getEntryName(), copyId, isParentCopyRoot); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), clone); } else { FSTransactionInfo txn = myTxnRoot.getTxn(); parentPath.setRevNode(clone);
String pathSoFar = "/"; FSParentPath parentPath = new FSParentPath(here, null, null); parentPath.setCopyStyle(FSCopyInheritance.COPY_ID_INHERIT_SELF); if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NOT_FOUND) { if (!lastEntryMustExist && (next == null || "".equals(next))) { return new FSParentPath(null, entry, parentPath); parentPath.setParentPath(child, entry, storeParents ? new FSParentPath(parentPath) : null); parentPath.setCopyStyle(copyInheritance.getStyle()); parentPath.setCopySourcePath(copyInheritance.getCopySourcePath());
public void makeDir(String path) throws SVNException { SVNPathUtil.checkPathIsValid(path); String txnId = myTxnRoot.getTxnID(); FSParentPath parentPath = myTxnRoot.openPath(path, false, true); if (parentPath.getRevNode() != null) { SVNErrorManager.error(FSErrors.errorAlreadyExists(myTxnRoot, path, myFSFS)); } if ((myTxnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) { FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, true, false); } makePathMutable(parentPath.getParent(), path); FSRevisionNode subDirNode = makeEntry(parentPath.getParent().getRevNode(), parentPath.getParent().getAbsPath(), parentPath.getNameEntry(), true, txnId); myTxnRoot.putRevNodeToCache(parentPath.getAbsPath(), subDirNode); addChange(path, subDirNode.getId(), FSPathChangeKind.FS_PATH_CHANGE_ADD, false, false, FSRepository.SVN_INVALID_REVNUM, null); }
path = SVNPathUtil.canonicalizeAbsolutePath(path); FSParentPath parentPath = revRoot.openPath(path, true, true); if (inherit == SVNMergeInfoInheritance.NEAREST_ANCESTOR && parentPath.getParent() == null) { return mergeInfo; nearestAncestor = parentPath.getParent(); } else { nearestAncestor = parentPath; boolean hasMergeInfo = nearestAncestor.getRevNode().hasMergeInfo(); if (hasMergeInfo) { break; nearestAncestor = nearestAncestor.getParent(); if (nearestAncestor == null) { return mergeInfo; SVNProperties propList = nearestAncestor.getRevNode().getProperties(fsfs); String mergeInfoString = propList.getStringValue(SVNProperty.MERGE_INFO); if (mergeInfoString == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Node-revision ''{0}@{1}'' claims to have mergeinfo but doesn''t", new Object[] { nearestAncestor.getAbsPath(), new Long(revRoot.getRevision()) }); SVNErrorManager.error(err, SVNLogType.FSFS); tmpMergeInfo = SVNMergeInfoUtil.getInheritableMergeInfo(tmpMergeInfo, null, SVNRepository.INVALID_REVISION, SVNRepository.INVALID_REVISION); mergeInfo = appendToMergedFroms(tmpMergeInfo, parentPath.getRelativePath(nearestAncestor)); return mergeInfo;
public FSCopyInheritance getCopyInheritance(FSParentPath child) throws SVNException { if (child == null || child.getParent() == null || myTxnID == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error: invalid txn name or child"); SVNErrorManager.error(err, SVNLogType.FSFS); FSID childID = child.getRevNode().getId(); FSID parentID = child.getParent().getRevNode().getId(); String childCopyID = childID.getCopyID(); String parentCopyID = parentID.getCopyID(); long copyrootRevision = child.getRevNode().getCopyRootRevision(); String copyrootPath = child.getRevNode().getCopyRootPath(); String idPath = child.getRevNode().getCreatedPath(); if (idPath.compareTo(child.getAbsPath()) == 0) { copyInheritance.setStyle(FSCopyInheritance.COPY_ID_INHERIT_SELF); return copyInheritance;
public FSRevisionNode getRevisionNode(String path) throws SVNException { path = SVNPathUtil.canonicalizeAbsolutePath(path); FSRevisionNode node = fetchRevNodeFromCache(path); if (node == null) { FSParentPath parentPath = openPath(path, true, false); node = parentPath.getRevNode(); } return node; }
public void incrementMergeInfoUpTree(FSParentPath parentPath, long increment) throws SVNException { while (parentPath != null) { myTxnRoot.incrementMergeInfoCount(parentPath.getRevNode(), increment); parentPath = parentPath.getParent(); } }
public String getAbsPath() throws SVNException { String pathSoFar = "/"; if (myParent != null) { pathSoFar = myParent.getAbsPath(); } return SVNPathUtil.getAbsolutePath(SVNPathUtil.append(pathSoFar, getEntryName())); }