for (Iterator entries = logEntries.iterator(); entries.hasNext();) { SVNLogEntry logEntry = (SVNLogEntry) entries.next(); if (logEntry.getChangedPaths().size() > 0) { Set<String> changedPathsSet = logEntry.getChangedPaths().keySet(); for (Iterator<String> changedPaths = changedPathsSet.iterator(); changedPaths .hasNext();) { SVNLogEntryPath entryPath = (SVNLogEntryPath) logEntry .getChangedPaths().get(changedPaths.next()); String path = entryPath.getPath(); if (!path.startsWith(updatePath)) { continue; }
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { for (String changedPath : logEntry.getChangedPaths().keySet()) { File removedPath = null; for (Iterator<File> immediateChildAbsPath = result.keySet().iterator(); immediateChildAbsPath.hasNext();) { File iPath = immediateChildAbsPath.next(); String reposPath = result.get(iPath); if (reposPath != null && SVNPathUtil.isAncestor(reposPath, changedPath)) { removedPath = iPath; break; } } if (removedPath != null) { result.remove(removedPath); } } } });
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { Map changedPaths = logEntry.getChangedPaths(); for (Iterator changedPathsIter = changedPaths.keySet().iterator(); changedPathsIter.hasNext();) { String path = (String) changedPathsIter.next(); SVNLogEntryPath change = (SVNLogEntryPath) changedPaths.get(path); if (myPath.equals(path) && (change.getType() == SVNLogEntryPath.TYPE_DELETED || change.getType() == SVNLogEntryPath.TYPE_REPLACED)) { myDeletedRevision = logEntry.getRevision(); } } }
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { Map changedPaths = logEntry.getChangedPaths(); for (Iterator changedPathsIter = changedPaths.keySet().iterator(); changedPathsIter.hasNext();) { String path = (String) changedPathsIter.next(); SVNLogEntryPath change = (SVNLogEntryPath) changedPaths.get(path); if (myPath.equals(path) && (change.getType() == SVNLogEntryPath.TYPE_DELETED || change.getType() == SVNLogEntryPath.TYPE_REPLACED)) { myDeletedRevision = logEntry.getRevision(); } } }
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { Map changedPaths = logEntry.getChangedPaths(); for (Iterator changedPathsIter = changedPaths.keySet().iterator(); changedPathsIter.hasNext();) { String path = (String) changedPathsIter.next(); SVNLogEntryPath change = (SVNLogEntryPath) changedPaths.get(path); if (myPath.equals(path) && (change.getType() == SVNLogEntryPath.TYPE_DELETED || change.getType() == SVNLogEntryPath.TYPE_REPLACED)) { myDeletedRevision = logEntry.getRevision(); } } }
private List<Modification> getModifications(SVNRepository repository, SVNURL url, long revision, SVNLogEntry logEntry) throws SVNException, UnsupportedEncodingException { List<Modification> modifications = new ArrayList<Modification>(); for (Entry<String, SVNLogEntryPath> entry : logEntry.getChangedPaths().entrySet()) { SVNLogEntryPath e = entry.getValue(); String diffText = getDiffText(repository, url, e, revision); String sc = getSourceCode(repository, revision, e); Modification modification = new Modification(e.getCopyPath(), e.getPath(), getModificationType(e), diffText, sc); modifications.add(modification); } return modifications; }
public void handleLogEntry( SVNLogEntry logEntry ) throws SVNException { List<ChangeFile> changedFiles = new ArrayList<ChangeFile>(); for ( String changedPath : logEntry.getChangedPaths().keySet() ) { changedFiles.add( new ChangeFile( changedPath, Long.toString( logEntry.getRevision() ) ) ); } SvnChangeSet changeSet = new SvnChangeSet( logEntry.getDate(), logEntry.getMessage(), logEntry.getAuthor(), changedFiles ); changeSet.setRevision( Long.toString( logEntry.getRevision() ) ); changeSets.add( changeSet ); }
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { Revision rev = new Revision(); rev.myPath = myPath; rev.myRevision = logEntry.getRevision(); rev.myProperties = logEntry.getRevisionProperties(); myRevisions.addFirst(rev); myPath = getPreviousLogPath(null, null, logEntry.getChangedPaths(), myPath, SVNNodeKind.FILE, logEntry.getRevision()); }
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { Revision rev = new Revision(); rev.myPath = myPath; rev.myRevision = logEntry.getRevision(); rev.myProperties = logEntry.getRevisionProperties(); myRevisions.addFirst(rev); myPath = getPreviousLogPath(null, null, logEntry.getChangedPaths(), myPath, SVNNodeKind.FILE, logEntry.getRevision()); }
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { Revision rev = new Revision(); rev.myPath = myPath; rev.myRevision = logEntry.getRevision(); rev.myProperties = logEntry.getRevisionProperties(); myRevisions.addFirst(rev); myPath = getPreviousLogPath(null, null, logEntry.getChangedPaths(), myPath, SVNNodeKind.FILE, logEntry.getRevision()); }
public static LogMessage createLogMessage(SVNLogEntry logEntry) { if(logEntry == null){ return null; } Map cpaths = logEntry.getChangedPaths(); ChangePath[] cp = null; if(cpaths == null){ cp = new ChangePath[]{}; }else{ Collection clientChangePaths = new ArrayList(); for (Iterator iter = cpaths.keySet().iterator(); iter.hasNext();) { String path = (String) iter.next(); SVNLogEntryPath entryPath = (SVNLogEntryPath)cpaths.get(path); if(entryPath != null){ clientChangePaths.add(new ChangePath(path, entryPath.getCopyRevision(), entryPath.getCopyPath(), entryPath.getType())); } } cp = (ChangePath[]) clientChangePaths.toArray(new ChangePath[clientChangePaths.size()]); } return new LogMessage(logEntry.getMessage(), logEntry.getDate(), logEntry.getRevision(), logEntry.getAuthor(), cp); }
private void indexSVNStopEvents(SVNRepository repository, SVNLogEntry logEntry) { long revision = logEntry.getRevision(); // Looking for copy tags @SuppressWarnings("unchecked") Map<String, SVNLogEntryPath> changedPaths = logEntry.getChangedPaths(); // For all changes path for (SVNLogEntryPath logEntryPath : changedPaths.values()) { String path = logEntryPath.getPath(); if (logEntryPath.getType() == SVNLogEntryPath.TYPE_DELETED && svnClient.isTagOrBranch(repository, path)) { logger.debug(String.format("\tSTOP %s", path)); // Adds the stop event eventDao.createStopEvent(repository.getId(), revision, path); } } }
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { callback.singleMessage(getChangePaths(logEntry.getChangedPaths()), logEntry.getRevision(), getProperties(logEntry.getRevisionProperties()), logEntry.hasChildren()); } };
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { if (myEventHandler != null) { myEventHandler.checkCancelled(); } if (logEntry.getChangedPaths() == null) { return; } if (myCurrentPath == null) { return; } if (myStartPath == null && logEntry.getRevision() <= myStartRevision) { myStartPath = myCurrentPath; } if (myEndPath == null && logEntry.getRevision() <= myEndRevision) { myEndPath = myCurrentPath; } if (myPegPath == null && logEntry.getRevision() <= myPegRevision) { myPegPath = myCurrentPath; } myCurrentPath = getPreviousLogPath(myCurrentPath, logEntry, myKind); } }
public void receive(SvnTarget target, SVNLogEntry svnLogEntry) throws SVNException { callback.singleMessage(getChangePaths(svnLogEntry.getChangedPaths()), svnLogEntry.getRevision(), getProperties(svnLogEntry.getRevisionProperties()), svnLogEntry.hasChildren()); } };
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { if (myEventHandler != null) { myEventHandler.checkCancelled(); } if (logEntry.getChangedPaths() == null) { return; } if (myCurrentPath == null) { return; } if (myStartPath == null && logEntry.getRevision() <= myStartRevision) { myStartPath = myCurrentPath; } if (myEndPath == null && logEntry.getRevision() <= myEndRevision) { myEndPath = myCurrentPath; } if (myPegPath == null && logEntry.getRevision() <= myPegRevision) { myPegPath = myCurrentPath; } myCurrentPath = getPreviousLogPath(myCurrentPath, logEntry, myKind); } }
final SvnOperationFactory svnOperationFactory = new SvnOperationFactory(); final SvnLog log = svnOperationFactory.createLog(); log.setSingleTarget(SvnTarget.fromURL(url)); log.addRange(SvnRevisionRange.create(SVNRevision.create(12345), SVNRevision.create(12345))); log.setDiscoverChangedPaths(true); final SVNLogEntry logEntry = log.run(); final Map<String,SVNLogEntryPath> changedPaths = logEntry.getChangedPaths(); for (Map.Entry<String, SVNLogEntryPath> entry : changedPaths.entrySet()) { final SVNLogEntryPath svnLogEntryPath = entry.getValue(); System.out.println(svnLogEntryPath.getType() + " " + svnLogEntryPath.getPath() + (svnLogEntryPath.getCopyPath() == null ? "" : (" from " + svnLogEntryPath.getCopyPath() + ":" + svnLogEntryPath.getCopyRevision()))); }
private LogEntry(@NotNull SVNLogEntry logEntry) { this(logEntry.getRevision(), logEntry.getMessage(), convert(logEntry.getChangedPaths().values())); }
private void checkCopyFrom(@NotNull SVNRepository repo, @NotNull CopyFromSVNEditor editor, long revision) throws SVNException { final Map<String, String> copyFrom = new TreeMap<>(); repo.log(new String[]{""}, revision, revision, true, true, logEntry -> { for (SVNLogEntryPath entry : logEntry.getChangedPaths().values()) { if (entry.getCopyPath() != null) { copyFrom.put(entry.getPath(), entry.getCopyPath() + "@" + entry.getCopyRevision()); } } }); Assert.assertEquals(editor.getCopyFrom(), copyFrom); }
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { if (myIsDone) { return; } long[] copyFromRevision = { INVALID_REVISION }; String prevPath = getPreviousLogPath(null, copyFromRevision, logEntry.getChangedPaths(), myLastPath, myNodeKind, logEntry.getRevision()); if (prevPath == null) { myIsDone = true; maybeCropAndSendSegment(myLastPath, myStartRevision, logEntry.getRevision(), myRangeEnd, myHandler); return; } if (isValidRevision(copyFromRevision[0])) { maybeCropAndSendSegment(myLastPath, myStartRevision, logEntry.getRevision(), myRangeEnd, myHandler); myRangeEnd = logEntry.getRevision() - 1; if (logEntry.getRevision() - copyFromRevision[0] > 1) { maybeCropAndSendSegment(null, myStartRevision, copyFromRevision[0] + 1, myRangeEnd, myHandler); myRangeEnd = copyFromRevision[0]; } myLastPath = prevPath; } }