Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r3755 - trunk/subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/history/SVNHistoryPage.java

subclipse
Discussion topic

Back to topic list

svn commit: r3755 - trunk/subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/history/SVNHistoryPage.java

Author selsemore
Full name Stephen Elsemore
Date 2008-03-14 08:34:03 PDT
Message Author: selsemore
Date: 2008-03-14 08:34:02-0700
New Revision: 3755

Modified:
   trunk/subclipse/org.​tigris.subversion.su​bclipse.ui/src/org/t​igris/subversion/sub​clipse/ui/history/SV​NHistoryPage.java

Log:
When history view is filtered by revision range, only retrieve revisions in
the filter range rather than retrieving all revisions and then applying filter.

Modified: trunk/subclipse/org.​tigris.subversion.su​bclipse.ui/src/org/t​igris/subversion/sub​clipse/ui/history/SV​NHistoryPage.java
Url: http://subclipse.tig​ris.org/source/brows​e/subclipse/trunk/su​bclipse/org.tigris.s​ubversion.subclipse.​ui/src/org/tigris/su​bversion/subclipse/u​i/history/SVNHistory​Page.java?view=diff​&rev=3755&p1=​trunk/subclipse/org.​tigris.subversion.su​bclipse.ui/src/org/t​igris/subversion/sub​clipse/ui/history/SV​NHistoryPage.java​&p2=trunk/subclipse​/org.tigris.subversi​on.subclipse.ui/src/​org/tigris/subversio​n/subclipse/ui/histo​ry/SVNHistoryPage.ja​va&r1=3754&r​2=3755
====================​====================​====================​==================
--- trunk/subclipse/org.​tigris.subversion.su​bclipse.ui/src/org/t​igris/subversion/sub​clipse/ui/history/SV​NHistoryPage.java (original)
+++ trunk/subclipse/org.​tigris.subversion.su​bclipse.ui/src/org/t​igris/subversion/sub​clipse/ui/history/SV​NHistoryPage.java 2008-03-14 08:34:02-0700
@@ -541,6 +541,14 @@
         final ISVNRemoteResource remoteResource = (ISVNRemoteResource) inputElement;
 
         int entriesToFetch = store.getInt(ISVNUIC​onstants.PREF_LOG_EN​TRIES_TO_FETCH);
+
+ // If we are filtering by revision range, override entries to fetch.
+ if (historySearchDialog != null && !historySearchDialog​.getSearchAllLogs())​ {
+ if (historySearchDialog​.getStartRevision() != null || historySearchDialog.​getEndRevision() != null) {
+ if (getClearSearchActio​n().isEnabled()) entriesToFetch = 0;
+ }
+ }
+
         if (entriesToFetch > 0)
             fetchLogEntriesJob = new FetchLogEntriesJob();
         else
@@ -2140,6 +2148,9 @@
                               }
                             }
                           setEnabled(false);
+ if (!historySearchDialo​g.getSearchAllLogs()​ && (historySearchDialog​.getStartRevision() != null || historySearchDialog.​getEndRevision() != null)) {
+ getRefreshAction().run();
+ }
                       }
                   });
               }
@@ -2470,7 +2481,21 @@
 
         protected ILogEntry[] getLogEntries(IProgressMonitor monitor, ISVNRemoteResource remoteResource, SVNRevision pegRevision, SVNRevision revisionStart, SVNRevision revisionEnd, boolean stopOnCopy, long limit, AliasManager tagManager, boolean includeMergedRevisions) throws TeamException
         {
- GetLogsCommand logCmd = new GetLogsCommand(remoteResource, pegRevision, revisionStart, revisionEnd, stopOnCopy, limit, tagManager, includeMergedRevisions);
+ // If filtering by revision range, pass upper/lower revisions to API and override limit.
+ SVNRevision start = revisionStart;
+ SVNRevision end = revisionEnd;
+ long fetchLimit = limit;
+ if (historySearchDialog != null && !historySearchDialog​.getSearchAllLogs())​ {
+ if (historySearchDialog​.getStartRevision() != null || historySearchDialog.​getEndRevision() != null) {
+ if (getClearSearchActio​n().isEnabled()) {
+ if (historySearchDialog​.getStartRevision() != null) end = historySearchDialog.​getStartRevision();
+ if (historySearchDialog​.getEndRevision() != null) start = historySearchDialog.​getEndRevision();
+ fetchLimit = 0;
+ getGetNextAction().s​etEnabled(false);
+ }
+ }
+ }
+ GetLogsCommand logCmd = new GetLogsCommand(remoteResource, pegRevision, start, end, stopOnCopy, fetchLimit, tagManager, includeMergedRevisions);
             logCmd.run(monitor);
             return logCmd.getLogEntries();
         }
@@ -2536,64 +2561,75 @@
       }
       
       public IStatus run(IProgressMonitor monitor) {
-
- Date startDate = historySearchDialog.​getStartDate();
- setEmptyViewerFilter();
-
- // Fetch log entries until start date
- if (historySearchDialog​.getAutoFetchLogs())​ {
- if (!historySearchDialo​g.getSearchAllLogs()​) {
- Date lastDate = null;
- if (lastEntry != null) {
- lastDate = lastEntry.getDate();
- }
- int numEntries = entries.length;
- int prevNumEntries = -1;
- while ((numEntries != prevNumEntries) &&
- ((lastDate == null) ||
- (startDate == null) ||
- (startDate.compareTo(lastDate) <= 0))) {
-
- if (monitor.isCanceled()) {
- getSearchAction().se​tEnabled(true);
- removeEmptyViewerFilter();
- return Status.CANCEL_STATUS;
- }
-
- final ISVNRemoteResource remoteResource = historyTableProvider​.getRemoteResource()​;
- if(fetchNextLogEntriesJob == null) {
- fetchNextLogEntriesJob = new FetchNextLogEntriesJob();
- }
- if(fetchNextLogEntri​esJob.getState() != Job.NONE) {
- fetchNextLogEntriesJ​ob.cancel();
- }
- fetchNextLogEntriesJ​ob.setRemoteFile(rem​oteResource);
- Utils.schedule(fetch​NextLogEntriesJob, getSite());
- try {
- fetchNextLogEntriesJob.join();
- } catch(InterruptedException e) {
- SVNUIPlugin.log(new SVNException(
- Policy.bind("History​View.errorFetchingEn​tries", remoteResource.getName()), e)); //$NON-NLS-1$
+ if (!historySearchDialo​g.getSearchAllLogs()​ && (historySearchDialog​.getStartRevision() != null || historySearchDialog.​getEndRevision() != null)) {
+ final ISVNRemoteResource remoteResource = historyTableProvider​.getRemoteResource()​;
+ if(fetchAllLogEntriesJob == null) {
+ fetchAllLogEntriesJob = new FetchAllLogEntriesJob();
+ }
+ if(fetchAllLogEntrie​sJob.getState() != Job.NONE) {
+ fetchAllLogEntriesJob.cancel();
+ }
+ fetchAllLogEntriesJo​b.setRemoteFile(remo​teResource);
+ Utils.schedule(fetch​AllLogEntriesJob, getSite());
+ } else {
+ Date startDate = historySearchDialog.​getStartDate();
+ setEmptyViewerFilter();
+
+ // Fetch log entries until start date
+ if (historySearchDialog​.getAutoFetchLogs())​ {
+ if (!historySearchDialo​g.getSearchAllLogs()​) {
+ Date lastDate = null;
+ if (lastEntry != null) {
+ lastDate = lastEntry.getDate();
                       }
-
- if (entries.length == 0) {
- break;
+ int numEntries = entries.length;
+ int prevNumEntries = -1;
+ while ((numEntries != prevNumEntries) &&
+ ((lastDate == null) ||
+ (startDate == null) ||
+ (startDate.compareTo(lastDate) <= 0))) {
+
+ if (monitor.isCanceled()) {
+ getSearchAction().se​tEnabled(true);
+ removeEmptyViewerFilter();
+ return Status.CANCEL_STATUS;
+ }
+
+ final ISVNRemoteResource remoteResource = historyTableProvider​.getRemoteResource()​;
+ if(fetchNextLogEntriesJob == null) {
+ fetchNextLogEntriesJob = new FetchNextLogEntriesJob();
+ }
+ if(fetchNextLogEntri​esJob.getState() != Job.NONE) {
+ fetchNextLogEntriesJ​ob.cancel();
+ }
+ fetchNextLogEntriesJ​ob.setRemoteFile(rem​oteResource);
+ Utils.schedule(fetch​NextLogEntriesJob, getSite());
+ try {
+ fetchNextLogEntriesJob.join();
+ } catch(InterruptedException e) {
+ SVNUIPlugin.log(new SVNException(
+ Policy.bind("History​View.errorFetchingEn​tries", remoteResource.getName()), e)); //$NON-NLS-1$
+ }
+
+ if (entries.length == 0) {
+ break;
+ }
+ lastDate = lastEntry.getDate();
+ prevNumEntries = numEntries;
+ numEntries = entries.length;
                       }
- lastDate = lastEntry.getDate();
- prevNumEntries = numEntries;
- numEntries = entries.length;
                   }
- }
- else {
- final ISVNRemoteResource remoteResource = historyTableProvider​.getRemoteResource()​;
- if(fetchAllLogEntriesJob == null) {
- fetchAllLogEntriesJob = new FetchAllLogEntriesJob();
- }
- if(fetchAllLogEntrie​sJob.getState() != Job.NONE) {
- fetchAllLogEntriesJob.cancel();
- }
- fetchAllLogEntriesJo​b.setRemoteFile(remo​teResource);
- Utils.schedule(fetch​AllLogEntriesJob, getSite());
+ else {
+ final ISVNRemoteResource remoteResource = historyTableProvider​.getRemoteResource()​;
+ if(fetchAllLogEntriesJob == null) {
+ fetchAllLogEntriesJob = new FetchAllLogEntriesJob();
+ }
+ if(fetchAllLogEntrie​sJob.getState() != Job.NONE) {
+ fetchAllLogEntriesJob.cancel();
+ }
+ fetchAllLogEntriesJo​b.setRemoteFile(remo​teResource);
+ Utils.schedule(fetch​AllLogEntriesJob, getSite());
+ }
               }
           }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r3755 - trunk/subclipse/org.tigris.subversion.subclipse.ui/src/org/tigris/subversion/subclipse/ui/history/SVNHistoryPage.java selsemore Stephen Elsemore 2008-03-14 08:34:03 PDT
Messages per page: