private IProject assignLocalProject(final IProject baseProject,
final String newProjectName, String projectID, final VCSAdapter vcs,
final SubMonitor monitor, ProjectExchangeInfo projectInfo)
throws LocalCancellationException {
IProject newLocalProject = baseProject;
FileList remoteFileList = projectInfo.getFileList();
// if the baseProject already exists
if (newLocalProject != null) {
if (newLocalProject.getName().equals(newProjectName)) {
// TODO the project could be managed by a different Team
// provider
if (vcs != null && !vcs.isManaged(newLocalProject)
&& !projectInfo.isPartial()) {
String repositoryRoot = remoteFileList.getRepositoryRoot();
final String url = remoteFileList.getProjectInfo().url;
String directory = url.substring(repositoryRoot.length());
vcs.connect(newLocalProject, repositoryRoot, directory,
monitor);
}
}