internal override string OnFileChangeSelected(IResource repository, FileChange fileChange) { if (!fileChange.HasProp(Props.Diff)) { Core.NetworkAP.QueueJob(JobPriority.Immediate, "Loading Subversion diff", () => GetDiff(repository, fileChange)); return("Loading diff..."); } return(null); }
private void GetDiff(IResource repository, FileChange fileChange) { if (fileChange.HasProp(Props.Diff)) { return; } int revision = fileChange.Revision; if (revision == 1) { return; } string repoRoot = repository.GetProp(Props.RepositoryRoot); if (repoRoot == null) { try { repoRoot = GetRunner(repository).GetSvnInfo("Repository Root:"); ClearLastError(repository); } catch (RunnerException ex) { SetLastError(repository, ex); return; } new ResourceProxy(repository).SetPropAsync(Props.RepositoryRoot, repoRoot); } string repoPath = BuildFileName(repository, fileChange); SvnRunner svnRunner = GetRunner(repository); svnRunner.RepositoryUrl = repoRoot; try { string diff = svnRunner.GetDiff(repoPath, revision - 1, revision); fileChange.Diff = diff; fileChange.SaveAsync(); if (diff == "") { CheckBinaryFile(repository, repoRoot, repoPath, fileChange); } ClearLastError(repository); } catch (RunnerException ex) { SetLastError(repository, ex); } }