protected override void OnCommit(ChangeSet changeSet, IProgressMonitor monitor) { var groupByWorkspace = from it in changeSet.Items let workspace = this.GetWorkspaceByLocalPath(it.LocalPath) group it by workspace into wg select wg; foreach (var workspace in groupByWorkspace) { var workspace1 = workspace; var changes = workspace.Key.PendingChanges.Where(pc => workspace1.Any(wi => string.Equals(pc.LocalItem, wi.LocalPath))).ToList(); Dictionary <int, WorkItemCheckinAction> workItems = null; if (changeSet.ExtendedProperties.Contains("TFS.WorkItems")) { workItems = (Dictionary <int, WorkItemCheckinAction>)changeSet.ExtendedProperties["TFS.WorkItems"]; } var result = workspace.Key.CheckIn(changes, changeSet.GlobalComment, workItems); if (result.Failures != null && result.Failures.Any(x => x.SeverityType == SeverityType.Error)) { MessageService.ShowError("Commit failed!", string.Join(Environment.NewLine, result.Failures.Select(f => f.Message))); ResolveConflictsView.Open(this, workspace1.Select(w => w.LocalPath).ToList()); break; } } foreach (var file in changeSet.Items.Where(i => !i.IsDirectory)) { FileService.NotifyFileChanged(file.LocalPath); } cache.RefreshItems(changeSet.Items.Select(i => i.LocalPath)); }
protected void OnResolveConflicts() { var items = base.GetItems(false); if (items.Count == 0) { return; } var item = items[0]; var repo = (TFSRepository)item.Repository; ResolveConflictsView.Open(repo, GetWorkingPaths(item)); }
protected override void Run() { var solution = IdeApp.ProjectOperations.CurrentSelectedSolution; List <FilePath> paths = new List <FilePath>(); //Add Solution paths.Add(solution.BaseDirectory); //Add linked files. foreach (var path in solution.GetItemFiles(true)) { if (!path.IsChildPathOf(solution.BaseDirectory)) { paths.Add(path); } } var repo = (TFSRepository)VersionControlService.GetRepository(solution); ResolveConflictsView.Open(repo, paths); }