Ejemplo n.º 1
0
        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'));
        }
Ejemplo n.º 2
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));
            }
        }
Ejemplo n.º 3
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));
            }
        }
Ejemplo n.º 4
0
        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');
        }