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 static CopySource createCopySource(SVNLocationEntry location) { return new CopySource(location.getPath(), Revision.getInstance(location.getRevision()), null); }
private void sendPathRevision(SVNLocationEntry pathRevision, SendBaton sendBaton, ISVNFileRevisionHandler handler) throws SVNException { SVNProperties revProps = myFSFS.getRevisionProperties(pathRevision.getRevision()); FSRevisionRoot root = myFSFS.createRevisionRoot(pathRevision.getRevision()); FSRevisionNode fileNode = root.getRevisionNode(pathRevision.getPath()); SVNProperties props = fileNode.getProperties(myFSFS); SVNProperties propDiffs = FSRepositoryUtil.getPropsDiffs(sendBaton.myLastProps, props); if (sendBaton.myLastRoot != null) { contentsChanged = FSRepositoryUtil.areFileContentsChanged(sendBaton.myLastRoot, sendBaton.myLastPath, root, pathRevision.getPath()); } else { contentsChanged = true; handler.openRevision(new SVNFileRevision(pathRevision.getPath(), pathRevision.getRevision(), revProps, propDiffs, pathRevision.isResultOfMerge())); if (contentsChanged) { SVNDeltaCombiner sourceCombiner = new SVNDeltaCombiner(); SVNDeltaCombiner targetCombiner = new SVNDeltaCombiner(); handler.applyTextDelta(pathRevision.getPath(), null); InputStream sourceStream = null; InputStream targetStream = null; targetStream = root.getFileStreamForPath(targetCombiner, pathRevision.getPath()); SVNDeltaGenerator deltaGenerator = getDeltaGenerator(); deltaGenerator.sendDelta(pathRevision.getPath(), sourceStream, 0, targetStream, handler, false); } finally { handler.closeRevision(pathRevision.getPath());
public int compare(Object arg0, Object arg1) { SVNLocationEntry pathRevision1 = (SVNLocationEntry) arg0; SVNLocationEntry pathRevision2 = (SVNLocationEntry) arg1; if (pathRevision1.getRevision() == pathRevision2.getRevision()) { return 0; } return pathRevision1.getRevision() < pathRevision2.getRevision() ? 1 : -1; } });
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; }
protected void startElement(DAVElement parent, DAVElement element, Attributes attrs) throws SVNException { if (parent == LOCATION_REPORT && element == LOCATION) { String revStr = attrs.getValue("rev"); if (revStr != null) { String path = attrs.getValue("path"); if (path != null && myLocationEntryHandler != null) { myLocationEntryHandler.handleLocationEntry(new SVNLocationEntry(Long.parseLong(revStr), path)); myCount++; } } } } protected void endElement(DAVElement parent, DAVElement element, StringBuffer cdata) throws SVNException {
SVNURL reposRoot = getReposRoot(null, url, pegRevision, null, null); SVNLocationEntry copyFromInfo = getCopySource(null, url, pegRevision); String copyFromPath = copyFromInfo.getPath();
for (Iterator oldPathRevsIter = oldPathRevisions.iterator(); oldPathRevsIter.hasNext();) { SVNLocationEntry oldPathRevision = (SVNLocationEntry) oldPathRevsIter.next(); Map mergedMergeInfo = oldPathRevision.getMergedMergeInfo(); if (mergedMergeInfo == null) { continue;
public static CopySource createCopySource(SVNLocationEntry location) { return new CopySource(location.getPath(), Revision.getInstance(location.getRevision()), null); }
private void sendPathRevision(SVNLocationEntry pathRevision, SendBaton sendBaton, ISVNFileRevisionHandler handler) throws SVNException { SVNProperties revProps = myFSFS.getRevisionProperties(pathRevision.getRevision()); FSRevisionRoot root = myFSFS.createRevisionRoot(pathRevision.getRevision()); FSRevisionNode fileNode = root.getRevisionNode(pathRevision.getPath()); SVNProperties props = fileNode.getProperties(myFSFS); SVNProperties propDiffs = FSRepositoryUtil.getPropsDiffs(sendBaton.myLastProps, props); if (sendBaton.myLastRoot != null) { contentsChanged = FSRepositoryUtil.areFileContentsChanged(sendBaton.myLastRoot, sendBaton.myLastPath, root, pathRevision.getPath()); } else { contentsChanged = true; handler.openRevision(new SVNFileRevision(pathRevision.getPath(), pathRevision.getRevision(), revProps, propDiffs, pathRevision.isResultOfMerge())); if (contentsChanged) { SVNDeltaCombiner sourceCombiner = new SVNDeltaCombiner(); SVNDeltaCombiner targetCombiner = new SVNDeltaCombiner(); handler.applyTextDelta(pathRevision.getPath(), null); InputStream sourceStream = null; InputStream targetStream = null; targetStream = root.getFileStreamForPath(targetCombiner, pathRevision.getPath()); SVNDeltaGenerator deltaGenerator = getDeltaGenerator(); deltaGenerator.sendDelta(pathRevision.getPath(), sourceStream, 0, targetStream, handler, false); } finally { handler.closeRevision(pathRevision.getPath());
public int compare(Object arg0, Object arg1) { SVNLocationEntry pathRevision1 = (SVNLocationEntry) arg0; SVNLocationEntry pathRevision2 = (SVNLocationEntry) arg1; if (pathRevision1.getRevision() == pathRevision2.getRevision()) { return 0; } return pathRevision1.getRevision() < pathRevision2.getRevision() ? 1 : -1; } });
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()); }
SVNURL reposRoot = getReposRoot(path, null, pegRevision, null, null); SVNLocationEntry copyFromInfo = getCopySource(path, null, pegRevision); String copyFromPath = copyFromInfo.getPath(); SVNURL copyFromURL = null; if (copyFromPath != null) {
for (Iterator oldPathRevsIter = oldPathRevisions.iterator(); oldPathRevsIter.hasNext();) { SVNLocationEntry oldPathRevision = (SVNLocationEntry) oldPathRevsIter.next(); Map mergedMergeInfo = oldPathRevision.getMergedMergeInfo(); if (mergedMergeInfo == null) { continue;
private SVNLocationEntry findRealBaseLocation(Node node) throws SVNException { if (node.myAction == SVNChangeEntry.TYPE_ADDED && node.myCopyFromPath != null && SVNRevision.isValidRevisionNumber(node.myCopyFromRevision)) { return new SVNLocationEntry(node.myCopyFromRevision, node.myCopyFromPath); } if (node.myParent != null) { SVNLocationEntry location = findRealBaseLocation(node.myParent); return new SVNLocationEntry(location.getRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(location.getPath(), node.myName))); } return new SVNLocationEntry(-1, "/"); }
public static CopySource createCopySource(SVNLocationEntry location) { return new CopySource(location.getPath(), Revision.getInstance(location.getRevision()), null); }
private void sendPathRevision(SVNLocationEntry pathRevision, SendBaton sendBaton, ISVNFileRevisionHandler handler) throws SVNException { SVNProperties revProps = myFSFS.getRevisionProperties(pathRevision.getRevision()); FSRevisionRoot root = myFSFS.createRevisionRoot(pathRevision.getRevision()); FSRevisionNode fileNode = root.getRevisionNode(pathRevision.getPath()); SVNProperties props = fileNode.getProperties(myFSFS); SVNProperties propDiffs = FSRepositoryUtil.getPropsDiffs(sendBaton.myLastProps, props); if (sendBaton.myLastRoot != null) { contentsChanged = FSRepositoryUtil.areFileContentsChanged(sendBaton.myLastRoot, sendBaton.myLastPath, root, pathRevision.getPath()); } else { contentsChanged = true; handler.openRevision(new SVNFileRevision(pathRevision.getPath(), pathRevision.getRevision(), revProps, propDiffs, pathRevision.isResultOfMerge())); if (contentsChanged) { SVNDeltaCombiner sourceCombiner = new SVNDeltaCombiner(); SVNDeltaCombiner targetCombiner = new SVNDeltaCombiner(); handler.applyTextDelta(pathRevision.getPath(), null); InputStream sourceStream = null; InputStream targetStream = null; targetStream = root.getFileStreamForPath(targetCombiner, pathRevision.getPath()); SVNDeltaGenerator deltaGenerator = getDeltaGenerator(); deltaGenerator.sendDelta(pathRevision.getPath(), sourceStream, 0, targetStream, handler, false); } finally { handler.closeRevision(pathRevision.getPath());
public int compare(Object arg0, Object arg1) { SVNLocationEntry pathRevision1 = (SVNLocationEntry) arg0; SVNLocationEntry pathRevision2 = (SVNLocationEntry) arg1; if (pathRevision1.getRevision() == pathRevision2.getRevision()) { return 0; } return pathRevision1.getRevision() < pathRevision2.getRevision() ? 1 : -1; } });
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; }