public AddingVersionResponse AddNewVersion(string repositoryName, string tags) { CurrentProject project = _currentProjectRepository.FindCurrentProject(); if (project.BuildDirectory.IsMissing) { return(new AddingVersionResponse(AddingVersionResponse.Status.NoBuildDirectory)); } if (project.BuildDirectory.IsEmpty) { return(new AddingVersionResponse(AddingVersionResponse.Status.BuildDirectoryEmpty)); } RepositorySet repositorySet = project.RepositorySet; Repository repository; if (repositorySet.HasMoreThanOneRepository) { if (String.IsNullOrEmpty(repositoryName)) { return(new AddingVersionResponse(AddingVersionResponse.Status.AmbiguousRepositoryName)); } repository = repositorySet.FindRepositoryByName(repositoryName); } else { repository = repositorySet.DefaultRepository; } // ArchivedProjectAndVersion version = project.CreateNewVersion(); project.AddNewVersion(repository, new Tags(tags)); _repositoryRepository.SaveRepository(repository); return(new AddingVersionResponse(AddingVersionResponse.Status.Success)); }