public PathInfo getHistory(boolean strictNodeHistory, long start) throws SVNException { FSNodeHistory history = null; if (myHistory != null) { history = myHistory.getPreviousHistory(strictNodeHistory ? false : true); myHistory = history; } else { FSRevisionRoot historyRoot = myFSFS.createRevisionRoot(myHistoryRevision); history = historyRoot.getNodeHistory(myPath); history = history.getPreviousHistory(strictNodeHistory ? false : true); if (myIsFirstTime) { myIsFirstTime = false; } else if (history != null) { history = history.getPreviousHistory(strictNodeHistory ? false : true); } } if (history == null) { myIsDone = true; return this; } myPath = history.getHistoryEntry().getPath(); myHistoryRevision = history.getHistoryEntry().getRevision(); if (myHistoryRevision < start) { myIsDone = true; } return this; }
public FSNodeHistory fsHistoryPrev(boolean crossCopies, FSFS owner) throws SVNException { if ("/".equals(historyEntry.getPath())) { if (!isInteresting) { return new FSNodeHistory(new SVNLocationEntry(historyEntry.getRevision(), "/"), true, new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null)); } else if (historyEntry.getRevision() > 0) { return new FSNodeHistory(new SVNLocationEntry(historyEntry.getRevision() - 1, "/"), true, new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null)); } } else { FSNodeHistory prevHist = this; while (true) { prevHist = prevHist.historyPrev(crossCopies, owner); if (prevHist == null) { return null; } if (prevHist.isInteresting) { return prevHist; } } } return null; } }
public void pickUpNextHistory(boolean strict, long start) throws SVNException { if (myHistory == null) { return; } FSNodeHistory tempHist = myHistory.fsHistoryPrev(strict ? false : true, myFSFS); if (tempHist == null) { myHistory = null; return; } myHistory = tempHist; if (myHistory.getHistoryEntry().getRevision() < start) { myHistory = null; return; } }
public static boolean checkAncestryOfPegPath(String fsPath, long pegRev, long futureRev, FSFS owner) throws SVNException { FSRevisionRoot root = owner.createRevisionRoot(futureRev); FSNodeHistory history = getNodeHistory(root, fsPath); fsPath = null; SVNLocationEntry currentHistory = null; while (true) { history = history.fsHistoryPrev(true, owner); if (history == null) { break; } currentHistory = new SVNLocationEntry(history.getHistoryEntry().getRevision(), history.getHistoryEntry().getPath()); if (fsPath == null) { fsPath = currentHistory.getPath(); } if (currentHistory.getRevision() <= pegRev) { break; } } if (fsPath == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "FATAL error occurred while checking ancestry of peg path"); SVNErrorManager.error(err); } return (history != null && (fsPath.equals(currentHistory.getPath()))); }
if (revision == commitEntry.getRevision()) { if (!reported) { prevHist = new FSNodeHistory(commitEntry, true, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), myFSFS); SVNLocationEntry copyrootEntry = findYoungestCopyroot(myFSFS.getRepositoryRoot(), parentPath); SVNLocationEntry srcEntry = new SVNLocationEntry(SVNRepository.INVALID_REVISION, null); retry = true; return new FSNodeHistory(new SVNLocationEntry(dstRev, path), retry ? false : true, new SVNLocationEntry(srcEntry.getRevision(), srcEntry.getPath()), myFSFS); return new FSNodeHistory(commitEntry, true, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), myFSFS);
public static SVNLocationEntry findYoungestCopyroot(File reposRootDir, FSParentPath parPath) throws SVNException { SVNLocationEntry parentEntry = null; if (parPath.getParent() != null) { parentEntry = findYoungestCopyroot(reposRootDir, parPath.getParent()); } SVNLocationEntry myEntry = new SVNLocationEntry(parPath.getRevNode().getCopyRootRevision(), parPath.getRevNode().getCopyRootPath()); if (parentEntry != null) { if (myEntry.getRevision() >= parentEntry.getRevision()) { return myEntry; } return parentEntry; } return myEntry; }
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
isAncestor = FSNodeHistory.checkAncestryOfPegPath(path, pegRevision, locationRevs[count], myFSFS); if (isAncestor) { break;
public long getHistoryRevision() { return myHistory == null ? FSRepository.SVN_INVALID_REVNUM : myHistory.getHistoryEntry().getRevision(); }
if (revision == commitEntry.getRevision()) { if (!reported) { prevHist = new FSNodeHistory(commitEntry, true, new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null)); return prevHist; commitEntry = new SVNLocationEntry(revNode.getId().getRevision(), revNode.getCreatedPath()); SVNLocationEntry copyrootEntry = findYoungestCopyroot(owner.getRepositoryRoot(), parentPath); SVNLocationEntry srcEntry = new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null); long dstRev = FSRepository.SVN_INVALID_REVNUM; retry = true; return new FSNodeHistory(new SVNLocationEntry(dstRev, path), retry ? false : true, new SVNLocationEntry(srcEntry.getRevision(), srcEntry.getPath())); return new FSNodeHistory(commitEntry, true, new SVNLocationEntry(FSRepository.SVN_INVALID_REVNUM, null));
public static SVNLocationEntry findYoungestCopyroot(File reposRootDir, FSParentPath parPath) throws SVNException { SVNLocationEntry parentEntry = null; if (parPath.getParent() != null) { parentEntry = findYoungestCopyroot(reposRootDir, parPath.getParent()); } SVNLocationEntry myEntry = new SVNLocationEntry(parPath.getRevNode().getCopyRootRevision(), parPath.getRevNode().getCopyRootPath()); if (parentEntry != null) { if (myEntry.getRevision() >= parentEntry.getRevision()) { return myEntry; } return parentEntry; } return myEntry; }
FSNodeHistory history = FSNodeHistory.getNodeHistory(root, path); history = history.fsHistoryPrev(true, myFSFS); if (history == null) { break; long histRev = history.getHistoryEntry().getRevision(); String histPath = history.getHistoryEntry().getPath(); locationEntries.addFirst(new SVNLocationEntry(histRev, histPath)); if (histRev <= startRevision) {
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
isAncestor = FSNodeHistory.checkAncestryOfPegPath(path, pegRevision, locationRevs[count], myFSFS); if (isAncestor) { break;
public PathInfo getHistory(boolean strictNodeHistory, long start) throws SVNException { FSNodeHistory history = null; if (myHistory != null) { history = myHistory.getPreviousHistory(strictNodeHistory ? false : true); myHistory = history; } else { FSRevisionRoot historyRoot = myFSFS.createRevisionRoot(myHistoryRevision); history = historyRoot.getNodeHistory(myPath); history = history.getPreviousHistory(strictNodeHistory ? false : true); if (myIsFirstTime) { myIsFirstTime = false; } else if (history != null) { history = history.getPreviousHistory(strictNodeHistory ? false : true); } } if (history == null) { myIsDone = true; return this; } myPath = history.getHistoryEntry().getPath(); myHistoryRevision = history.getHistoryEntry().getRevision(); if (myHistoryRevision < start) { myIsDone = true; } return this; }
public FSNodeHistory getPreviousHistory(boolean crossCopies) throws SVNException { if ("/".equals(myHistoryEntry.getPath())) { if (!myIsInteresting) { return new FSNodeHistory(new SVNLocationEntry(myHistoryEntry.getRevision(), "/"), true, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), myFSFS); } else if (myHistoryEntry.getRevision() > 0) { return new FSNodeHistory(new SVNLocationEntry(myHistoryEntry.getRevision() - 1, "/"), true, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), myFSFS); } } else { FSNodeHistory prevHist = this; while (true) { prevHist = prevHist.historyPrev(crossCopies); if (prevHist == null) { return null; } if (prevHist.myIsInteresting) { return prevHist; } } } return null; } }
if (revision == commitEntry.getRevision()) { if (!reported) { prevHist = new FSNodeHistory(commitEntry, true, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), myFSFS); SVNLocationEntry copyrootEntry = findYoungestCopyroot(myFSFS.getRepositoryRoot(), parentPath); SVNLocationEntry srcEntry = new SVNLocationEntry(SVNRepository.INVALID_REVISION, null); retry = true; return new FSNodeHistory(new SVNLocationEntry(dstRev, path), retry ? false : true, new SVNLocationEntry(srcEntry.getRevision(), srcEntry.getPath()), myFSFS); return new FSNodeHistory(commitEntry, true, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), myFSFS);
public static SVNLocationEntry findYoungestCopyroot(File reposRootDir, FSParentPath parPath) throws SVNException { SVNLocationEntry parentEntry = null; if (parPath.getParent() != null) { parentEntry = findYoungestCopyroot(reposRootDir, parPath.getParent()); } SVNLocationEntry myEntry = new SVNLocationEntry(parPath.getRevNode().getCopyRootRevision(), parPath.getRevNode().getCopyRootPath()); if (parentEntry != null) { if (myEntry.getRevision() >= parentEntry.getRevision()) { return myEntry; } return parentEntry; } return myEntry; }
public FSNodeHistory getNodeHistory(String path) throws SVNException { SVNNodeKind kind = checkNodeKind(path); if (kind == SVNNodeKind.NONE) { SVNErrorManager.error(FSErrors.errorNotFound(this, path), SVNLogType.FSFS); } return new FSNodeHistory(new SVNLocationEntry(getRevision(), SVNPathUtil.canonicalizeAbsolutePath(path)), false, new SVNLocationEntry(SVNRepository.INVALID_REVISION, null), getOwner()); }
isAncestor = FSNodeHistory.checkAncestryOfPegPath(path, pegRevision, locationRevs[count], myFSFS); if (isAncestor) { break;