public FileDiffInfo GetFileDiffInfo(string filePath, Action <int, int> progress) { IDXVcsRepository dxRepository = DXVcsConnectionHelper.Connect(PortOptions.VcsServer); MergeHelper helper = new MergeHelper(toolWindowViewModel); string vcsFile = helper.GetMergeVcsPathByOriginalPath(filePath, PortOptions.MasterBranch); return(dxRepository.GetFileDiffInfo(vcsFile, progress, SpacesAction.IgnoreAll)); }
//void ShowExternalBlameInternal(Uri svnFile, int? lineNumber) { // if (string.IsNullOrEmpty(svnFile.ToString())) // throw new ArgumentException("svnFile"); // var startInfo = new ProcessStartInfo(); // startInfo.FileName = GetTortoiseProcPath(); // startInfo.Arguments = string.Format("/command:blame /path:{0} /startrev:0 /endrev:-1", svnFile.AbsoluteUri); // if (lineNumber.HasValue) // startInfo.Arguments += string.Format(" /line:{0}", lineNumber); // using (Process process = Process.Start(startInfo)) { // process.WaitForExit(); // } //} void PrepareBlameFileAndShowBlameUI(string filePath, int?lineNumber) { string blameFile = null; string logFile = null; try { IDXVcsRepository dxRepository = DXVcsConnectionHelper.Connect(portOptions.VcsServer); MergeHelper helper = new MergeHelper(options, portOptions); string vcsFile = helper.GetMergeVcsPathByOriginalPath(filePath, portOptions.MasterBranch); FileDiffInfo diffInfo = dxRepository.GetFileDiffInfo(vcsFile); int revision = diffInfo.LastRevision; IList <IBlameLine> blame = diffInfo.BlameAtRevision(revision); blameFile = MakeBlameFile(vcsFile, blame); logFile = MakeLog(blame); ShowExternalBlameInternal(filePath, vcsFile, blameFile, logFile, revision, lineNumber); } finally { blameFile.Do(File.Delete); logFile.Do(File.Delete); } }