private void addToDefaultSet(String name, SyncInfo info) { CheckedInChangeSet set; synchronized (this) { set = getChangeSetFor(name); if (set == null) { set = createDefaultChangeSet(name); add(set); } set.add(info); } }
/* * 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); } }