/* (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));
     }
 }
Exemplo n.º 2
0
  /**
   * Replace the old repository location with the new one assuming that they are the same location
   * with different authentication informations
   *
   * @param location
   * @param newLocation
   */
  public void replaceRepositoryLocation(
      final ICVSRepositoryLocation oldLocation, final CVSRepositoryLocation newLocation) {

    try {
      run(
          new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor)
                throws InvocationTargetException, InterruptedException {
              RepositoryRoot root = getRepositoryRootFor(oldLocation);
              // Disposing of the old location will result in the deletion of the
              // cached root through a listener callback
              KnownRepositories.getInstance().disposeRepository(oldLocation);

              // Get the new location from the CVS plugin to ensure we use the
              // instance that will be returned by future calls to getRepository()
              boolean isNew =
                  !KnownRepositories.getInstance().isKnownRepository(newLocation.getLocation());
              root.setRepositoryLocation(
                  KnownRepositories.getInstance()
                      .addRepository(newLocation, isNew /* broadcast */));
              add(root);
            }
          },
          Policy.monitorFor(null));
    } catch (InvocationTargetException e) {
      CVSException.wrapException(e);
    } catch (InterruptedException e) {
    }
  }