/* (non-Javadoc)
  * @see org.eclipse.team.ui.synchronize.SyncInfoSetChangeSetCollector#reset(org.eclipse.team.core.synchronize.SyncInfoSet)
  */
 public void reset(SyncInfoSet seedSet) {
   // Notify that handler to stop any fetches in progress
   LogEntryCacheUpdateHandler handler = getLogEntryHandler();
   if (handler != null) {
     handler.stopFetching();
   }
   super.reset(seedSet);
 }
 public synchronized LogEntryCacheUpdateHandler getLogEntryHandler() {
   LogEntryCacheUpdateHandler handler =
       (LogEntryCacheUpdateHandler) getConfiguration().getProperty(LOG_ENTRY_HANDLER);
   if (handler == null) {
     handler = initializeLogEntryHandler(getConfiguration());
   }
   handler.setListener(this);
   return handler;
 }
 /* (non-Javadoc)
  * @see org.eclipse.team.ui.synchronize.views.HierarchicalModelProvider#dispose()
  */
 public void dispose() {
   // No longer listen for log entry changes
   // (The handler is disposed with the page)
   disposed = true;
   LogEntryCacheUpdateHandler handler = getLogEntryHandler();
   if (handler != null) handler.setListener(null);
   getConfiguration().setProperty(CVSChangeSetCollector.CVS_CHECKED_IN_COLLECTOR, null);
   logEntryCache = null;
   super.dispose();
 }
 /*
  * Create a node for the given sync info object. The logs should contain the log for this info.
  *
  * @param info the info for which to create a node in the model
  * @param log the cvs log for this node
  */
 private void addSyncInfoToCommentNode(SyncInfo info, LogEntryCache logs) {
   LogEntryCacheUpdateHandler handler = getLogEntryHandler();
   if (handler != null) {
     ICVSRemoteResource remoteResource = handler.getRemoteResource(info);
     if (handler.getSubscriber() instanceof CVSCompareSubscriber && remoteResource != null) {
       addMultipleRevisions(info, logs, remoteResource);
     } else {
       addSingleRevision(info, logs, remoteResource);
     }
   }
 }
 /* (non-Javadoc)
  * @see org.eclipse.team.core.subscribers.SyncInfoSetChangeSetCollector#add(org.eclipse.team.core.synchronize.SyncInfo[])
  */
 protected void add(SyncInfo[] infos) {
   LogEntryCacheUpdateHandler handler = getLogEntryHandler();
   if (handler != null)
     try {
       handler.fetch(infos);
     } catch (CVSException e) {
       getConfiguration()
           .getSyncInfoSet()
           .addError(new TeamStatus(IStatus.ERROR, CVSUIPlugin.ID, 0, e.getMessage(), e, null));
     }
 }
 /* (non-Javadoc)
  * @see org.eclipse.team.ui.synchronize.SyncInfoSetChangeSetCollector#waitUntilDone(org.eclipse.core.runtime.IProgressMonitor)
  */
 public void waitUntilDone(IProgressMonitor monitor) {
   super.waitUntilDone(monitor);
   monitor.worked(1);
   // wait for the event handler to process changes.
   LogEntryCacheUpdateHandler handler = getLogEntryHandler();
   if (handler != null) {
     while (handler.getEventHandlerJob().getState() != Job.NONE) {
       monitor.worked(1);
       try {
         Thread.sleep(10);
       } catch (InterruptedException e) {
       }
       Policy.checkCanceled(monitor);
     }
   }
   monitor.worked(1);
 }
 /*
  * Add the remote change to an incoming commit set
  */
 private void addRemoteChange(
     SyncInfo info, ICVSRemoteResource remoteResource, ILogEntry logEntry) {
   if (disposed) return;
   LogEntryCacheUpdateHandler handler = getLogEntryHandler();
   if (handler != null
       && remoteResource != null
       && logEntry != null
       && handler.isRemoteChange(info)) {
     if (requiresCustomSyncInfo(info, remoteResource, logEntry)) {
       info =
           new CVSUpdatableSyncInfo(
               info.getKind(),
               info.getLocal(),
               info.getBase(),
               (RemoteResource) logEntry.getRemoteFile(),
               ((CVSSyncInfo) info).getSubscriber());
       try {
         info.init();
       } catch (TeamException e) {
         // this shouldn't happen, we've provided our own calculate kind
       }
     }
     // Only add the info if the base and remote differ
     IResourceVariant base = info.getBase();
     IResourceVariant remote = info.getRemote();
     if ((base == null && remote != null)
         || (remote == null && base != null)
         || (remote != null && base != null && !base.equals(remote))) {
       synchronized (this) {
         CheckedInChangeSet set = getChangeSetFor(logEntry);
         if (set == null) {
           set = createChangeSetFor(logEntry);
           add(set);
         }
         set.add(info);
       }
     }
   } else {
     // The info was not retrieved for the remote change for some reason.
     // Add the node to the root
     addToDefaultSet(DEFAULT_INCOMING_SET_NAME, info);
   }
 }