private static string GetRevision(BackupArguments args, DirectoryInfo repo) { int rev; // version using (var look = new SvnLook(SvnLook.Commands.Youngest)) { look.RepositoryPath = repo.FullName; if (!string.IsNullOrEmpty(args.SubverisonPath)) { look.ToolPath = args.SubverisonPath; } look.Execute(); if (!string.IsNullOrEmpty(look.StandardError)) { _log.Info(look.StandardError); } if (!look.TryGetRevision(out rev)) { _log.WarnFormat("'{0}' is not a repository.", repo.Name); if (!string.IsNullOrEmpty(look.StandardOutput)) { _log.Info(look.StandardOutput); } return(null); } } return("v" + rev.ToString().PadLeft(7, '0')); }
public void Youngest() { string repositoryPath = TestHelper.TestRepository; // make sure there is a repo TestHelper.CreateRepository(repositoryPath, false); using (var look = new SvnLook("youngest")) { look.RepositoryPath = repositoryPath; var r = look.Execute(); Assert.IsTrue(r); int rev; Assert.IsTrue(look.TryGetRevision(out rev)); } }
private static string GetRevision(BackupArguments args, DirectoryInfo repo) { int rev; // version using (var look = new SvnLook(SvnLook.Commands.Youngest)) { look.RepositoryPath = repo.FullName; if (!string.IsNullOrEmpty(args.SubverisonPath)) look.ToolPath = args.SubverisonPath; look.Execute(); if (!string.IsNullOrEmpty(look.StandardError)) _log.Info(look.StandardError); if (!look.TryGetRevision(out rev)) { _log.WarnFormat("'{0}' is not a repository.", repo.Name); if (!string.IsNullOrEmpty(look.StandardOutput)) _log.Info(look.StandardOutput); return null; } } return "v" + rev.ToString().PadLeft(7, '0'); }