public SvnRepository(ILogService logService, string repositoryPath, string workingPath) { this.repositoryPath = repositoryPath; this.transactionPath = Path.Combine(workingPath, "transaction"); this.logService = logService; var items = this.Run("stat", this.repositoryPath.WrapQuot(), "-q").Trim(); if (items != string.Empty) { var sb = new StringBuilder(); sb.AppendLine($"Repository is dirty. Please fix the problem before running the service."); sb.AppendLine(); sb.AppendLine(items); throw new Exception($"{sb}"); } this.Run("log", this.repositoryPath.WrapQuot(), "-l 1"); var info = SvnInfoEventArgs.Run(this.repositoryPath); this.repositoryRoot = info.RepositoryRoot; var repositoryInfo = SvnInfoEventArgs.Run($"{info.Uri}"); this.revision = repositoryInfo.Revision; }
public long GetRevision(string path) { var info = SvnInfoEventArgs.Run(path); var repositoryInfo = SvnInfoEventArgs.Run($"{info.Uri}"); return(repositoryInfo.LastChangeRevision); }
public Uri GetUri(string path, long revision) { var revisionValue = revision == -1 ? this.revision : revision; var info = SvnInfoEventArgs.Run(path, revisionValue); return(new Uri($"{info.Uri}@{revisionValue}")); }
public void GetBranchInfo(string path, out long revision, out string source, out long sourceRevision) { var info = SvnInfoEventArgs.Run(path); this.GetBranchRevision(info.RepositoryRoot, info.Uri, out revision, out source, out sourceRevision); }