void InitializeFileDiffInfo() { try { BusyIndicator.Show(); BusyIndicator.UpdateText("Loading file diff info: progress {0} from {1}"); fileDiffInfo = blameHelper.GetFileDiffInfo(filePath, BusyIndicator.UpdateProgress); } finally { BusyIndicator.Close(); } }
//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); } }