if (sharedProject.updateVcs(vcs)) {
if (vcs == null) {
// Disconnect
boolean deleteContent = oldVcs == null
|| !oldVcs.hasLocalCache(project);
VCSActivity activity = VCSActivity.disconnect(sarosSession,
project, deleteContent);
pendingActivities.enter(activity);
sharedProject.updateRevision(null);
sharedProject.updateVcsUrl(null);
} else {
// Connect
VCSResourceInfo info = vcs.getResourceInfo(project);
String repositoryString = vcs.getRepositoryString(project);
if (repositoryString == null || info.url == null) {
// HACK For some reason, Subclipse returns null values
// here. Pretend the vcs is still null and wait for the
// next time we get here.
sharedProject.updateVcs(null);
return false;
}
String directory = info.url
.substring(repositoryString.length());
VCSActivity activity = VCSActivity.connect(sarosSession,
project, repositoryString, directory,
vcs.getProviderID(project));
pendingActivities.enter(activity);
sharedProject.updateVcsUrl(info.url);
sharedProject.updateRevision(info.revision);