doLog(url, paths, pegRevision, startRevision, endRevision, stopOnCopy, discoverChangedPaths, false, limit, null, handler);
doLog(paths, startRevision, endRevision, pegRevision, stopOnCopy, discoverChangedPaths, false, limit, null, handler);
doLog(paths, startRevision, endRevision, pegRevision, stopOnCopy, discoverChangedPaths, false, limit, null, handler);
doLog(paths, startRevision, endRevision, SVNRevision.UNDEFINED, stopOnCopy, discoverChangedPaths, false, limit, null, handler);
public static void changelog( SVNClientManager clientManager, SVNURL svnUrl, SVNRevision startRevision, SVNRevision endRevision, boolean stopOnCopy, boolean reportPaths, ISVNLogEntryHandler handler ) throws SVNException { SVNLogClient logClient = clientManager.getLogClient(); logClient.doLog( svnUrl, null, startRevision, startRevision, endRevision, stopOnCopy, reportPaths, MAX_LOG_ENTRIES, handler ); }
@Override public void log(SVNRepository repository, SVNURL url, SVNRevision pegRevision, SVNRevision startRevision, SVNRevision stopRevision, boolean stopOnCopy, boolean discoverChangedPaths, long limit, boolean includeMergedRevisions, ISVNLogEntryHandler isvnLogEntryHandler) { try { getLogClient(repository).doLog(url, null, pegRevision, startRevision, stopRevision, stopOnCopy, discoverChangedPaths, includeMergedRevisions, limit, null, isvnLogEntryHandler); } catch (SVNException e) { throw translateSVNException(e); } }
private List<Revision> getSVNLogs(final SVNClientManager clientManager, final String[] paths, final SVNRevision startRevision, final int start, final int limit) throws StoreException.ReadException { try { final SVNLogClient logClient = clientManager.getLogClient(); final FilterableSVNLogEntryHandler handler = new FilterableSVNLogEntryHandler(); // In order to get history is "descending" order, the startRevision should be the one closer to HEAD logClient.doLog(svnUrl, paths, /* pegRevision */ SVNRevision.HEAD, startRevision, SVNRevision.create(1), /* stopOnCopy */ false, /* discoverChangedPaths */ false, /* includeMergedRevisions */ false, /* limit */ start + limit, new String[]{SVNRevisionProperty.LOG, SVNRevisionProperty.AUTHOR, SVNRevisionProperty.DATE}, handler); final List<SVNLogEntry> entries = handler.getLogEntries(); final List<Revision> revisions; if (entries.size() <= start) { revisions = Collections.emptyList(); } else { final int end = Math.min(start + limit, entries.size()); revisions = Lists.newArrayListWithCapacity(end - start); for (int i = 0; i < end - start; i++) { final SVNLogEntry entry = entries.get(start + i); revisions.add(new Revision(String.valueOf(entry.getRevision()), entry.getAuthor(), entry.getDate(), entry.getMessage())); } } return revisions; } catch (final SVNException e) { throw new StoreException.ReadException("Unable to get older revisions"); } }
logClient.doLog(svnUrl, targetPaths,
private List<Revision> getSVNLogs(final SVNClientManager clientManager, final String[] paths, final SVNRevision startRevision, final int start, final int limit) throws StoreException.ReadException { try { final SVNLogClient logClient = clientManager.getLogClient(); final FilterableSVNLogEntryHandler handler = new FilterableSVNLogEntryHandler(); // In order to get history is "descending" order, the startRevision should be the one closer to HEAD logClient.doLog(svnUrl, paths, /* pegRevision */ SVNRevision.HEAD, startRevision, SVNRevision.create(1), /* stopOnCopy */ false, /* discoverChangedPaths */ false, /* includeMergedRevisions */ false, /* limit */ start + limit, new String[]{SVNRevisionProperty.LOG, SVNRevisionProperty.AUTHOR, SVNRevisionProperty.DATE}, handler); final List<SVNLogEntry> entries = handler.getLogEntries(); final List<Revision> revisions; if (entries.size() <= start) { revisions = Collections.emptyList(); } else { final int end = Math.min(start + limit, entries.size()); revisions = Lists.newArrayListWithCapacity(end - start); for (int i = 0; i < end - start; i++) { final SVNLogEntry entry = entries.get(start + i); revisions.add(new Revision(String.valueOf(entry.getRevision()), entry.getAuthor(), entry.getDate(), entry.getMessage())); } } return revisions; } catch (final SVNException e) { throw new StoreException.ReadException("Unable to get older revisions"); } }
logClient.doLog(svnUrl, targetPaths,
listener.getLogger().printf("Computing changelog of %1s from %2s to %3s\n", SVNURL.parseURIEncoded(url), prevRev+1, thisRev); svnlc.doLog(SVNURL.parseURIEncoded(url), null, SVNRevision.UNDEFINED,
protected void getLogsForMergeInfoRangeList(SVNURL reposRootURL, String[] paths, SVNMergeRangeList rangeList, boolean discoverChangedPaths, String[] revProps, ISVNLogEntryHandler handler) throws SVNException { if (rangeList.isEmpty()) { return; } SVNMergeRange[] listRanges = rangeList.getRanges(); Arrays.sort(listRanges); SVNMergeRange youngestRange = listRanges[listRanges.length - 1]; SVNRevision youngestRev = SVNRevision.create(youngestRange.getEndRevision()); SVNMergeRange oldestRange = listRanges[0]; SVNRevision oldestRev = SVNRevision.create(oldestRange.getStartRevision()); LogHandlerFilter filterHandler = new LogHandlerFilter(handler, rangeList); SVNLogClient logClient = getLogClient(); logClient.doLog(reposRootURL, paths, youngestRev, oldestRev, youngestRev, false, discoverChangedPaths, false, 0, revProps, filterHandler); checkCancelled(); }
protected void getLogsForMergeInfoRangeList(SVNURL reposRootURL, String[] paths, SVNMergeRangeList rangeList, boolean discoverChangedPaths, String[] revProps, ISVNLogEntryHandler handler) throws SVNException { if (rangeList.isEmpty()) { return; } SVNMergeRange[] listRanges = rangeList.getRanges(); Arrays.sort(listRanges); SVNMergeRange youngestRange = listRanges[listRanges.length - 1]; SVNRevision youngestRev = SVNRevision.create(youngestRange.getEndRevision()); SVNMergeRange oldestRange = listRanges[0]; SVNRevision oldestRev = SVNRevision.create(oldestRange.getStartRevision()); LogHandlerFilter filterHandler = new LogHandlerFilter(handler, rangeList); SVNLogClient logClient = getLogClient(); logClient.doLog(reposRootURL, paths, youngestRev, oldestRev, youngestRev, false, discoverChangedPaths, false, 0, revProps, filterHandler); checkCancelled(); }
/** * Checks it the revision range [from,to] has any changes that are not excluded via exclusions. */ public boolean findNonExcludedChanges(SVNURL url, long from, long to, ISVNAuthenticationProvider authProvider) throws SVNException { if (from>to) return false; // empty revision range, meaning no change // if no exclusion rules are defined, don't waste time going through "svn log". if (!filter.hasExclusionRule()) return true; final SvnClientManager manager = createClientManager(authProvider); try { manager.getLogClient().doLog(url, null, SVNRevision.UNDEFINED, SVNRevision.create(from), // get log entries from the local revision + 1 SVNRevision.create(to), // to the remote revision false, // Don't stop on copy. true, // Report paths. false, // Don't included merged revisions 0, // Retrieve log entries for unlimited number of revisions. null, // Retrieve all revprops this); } finally { manager.dispose(); } return isChangesFound(); }
/** * Checks it the revision range [from,to] has any changes that are not excluded via exclusions. */ public boolean findNonExcludedChanges(SVNURL url, long from, long to, ISVNAuthenticationProvider authProvider) throws SVNException { if (from > to) { return false; // empty revision range, meaning no change } // if no exclusion rules are defined, don't waste time going through "svn log". if (!hasExclusionRule()) { return true; } final SVNClientManager manager = createSvnClientManager(authProvider); try { manager.getLogClient().doLog(url, null, SVNRevision.UNDEFINED, SVNRevision.create(from), // get log entries from the local revision + 1 SVNRevision.create(to), // to the remote revision false, // Don't stop on copy. true, // Report paths. false, // Don't included merged revisions 0, // Retrieve log entries for unlimited number of revisions. null, // Retrieve all revprops this); } finally { manager.dispose(); } return isChangesFound(); }
/** * Checks it the revision range [from,to] has any changes that are not excluded via exclusions. */ public boolean findNonExcludedChanges(SVNURL url, long from, long to, ISVNAuthenticationProvider authProvider) throws SVNException { if (from > to) { return false; // empty revision range, meaning no change } // if no exclusion rules are defined, don't waste time going through "svn log". if (!hasExclusionRule()) { return true; } final SVNClientManager manager = createSvnClientManager(authProvider); try { manager.getLogClient().doLog(url, null, SVNRevision.UNDEFINED, SVNRevision.create(from), // get log entries from the local revision + 1 SVNRevision.create(to), // to the remote revision false, // Don't stop on copy. true, // Report paths. false, // Don't included merged revisions 0, // Retrieve log entries for unlimited number of revisions. null, // Retrieve all revprops this); } finally { manager.dispose(); } return isChangesFound(); }
static List<Change> getChangesFromSubversion(@SuppressWarnings("rawtypes") AbstractBuild build, final Runner runner, SubversionSCM scm, final String remoteDebian, String latestRevision, String currentRevision, final String ourMessage) throws DebianizingException { final List<Change> result = new ArrayList<Change>(); ModuleLocation location = findOurLocation(build, scm, runner, remoteDebian); ISVNAuthenticationProvider authenticationProvider = ((SubversionSCM)build.getProject().getScm()).createAuthenticationProvider(build.getProject(), location); SvnClientManager manager = SubversionSCM.createClientManager(authenticationProvider); try { SVNURL svnurl = location.getSVNURL(); manager.getLogClient().doLog(svnurl, null, SVNRevision.UNDEFINED, SVNRevision.create(Long.parseLong(latestRevision) + 1), SVNRevision.parse(currentRevision), false, true, 0, new ISVNLogEntryHandler() { @Override public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { if (!logEntry.getMessage().equals(ourMessage)) { result.add(new Change(logEntry.getAuthor(), logEntry.getMessage())); } } }); } catch (SVNException e) { e.printStackTrace(); throw new DebianizingException("SVNException: " + e.getMessage(), e); } finally { manager.dispose(); } return result; }