Ejemplo n.º 1
0
        public static SvnResultsBase SvnUpdate(this ICakeContext context,
                                               string localPath)
        {
            SvnResultsBase results = new SvnResultsBase();
            SvnUpdate      task    = new SvnUpdate(context)
            {
                LocalPath = localPath
            };

            string actualCommand  = GetToolTaskCommand(task);
            string actualCommand2 = GetToolTaskToolPath(task);

            var bOk = task.Execute();

            if (task.ExitCode != 0)
            {
                //-- fail
            }
            results.RepositoryPath = task.RepositoryPath ?? "";
            results.Revision       = task.Revision;
            results.StandardOutput = task.StandardOutput ?? "";
            results.StandardError  = task.StandardError ?? "";
            results.ExitCode       = task.ExitCode;

            return(results);
        }
Ejemplo n.º 2
0
        private void buildBranches()
        {
            // Use SharpSvn to get branches
            IEnumerable<string> branches = new SvnUpdate().Branches();

            // For each branch, assume the project name is '#{Branch}.VDE-0017'
            foreach (var name in branches)
                this.updateAndBuild(name);
        }
Ejemplo n.º 3
0
        public void SvnUpdateCommand()
        {
            SvnUpdate task      = new SvnUpdate();
            string    localPath = @"c:\code";

            task.LocalPath = localPath;

            string expectedCommand = String.Format("update \"{0}\" --non-interactive --no-auth-cache", localPath);
            string actualCommand   = TaskUtility.GetToolTaskCommand(task);

            Assert.AreEqual(expectedCommand, actualCommand);
        }
Ejemplo n.º 4
0
        public void SvnUpdateCommand()
        {
            var       context   = new Cake.VersionReader.Tests.Fakes.FakeCakeContext();
            SvnUpdate task      = new SvnUpdate(context.CakeContext);
            string    localPath = @"c:\code";

            task.LocalPath = localPath;

            string expectedCommand = String.Format("update \"{0}\" --non-interactive --no-auth-cache", localPath);
            string actualCommand   = TaskUtility.GetToolTaskCommand(task);

            Assert.AreEqual(expectedCommand, actualCommand);
        }
        public void TestUpdateNormalWithSSL()
        {
            MockRepository repository = new MockRepository();
            IBuildEngine engine = repository.StrictMock<IBuildEngine>();

            string path = string.Format(RepositoryPathTemplate, DateTime.Now.Ticks);
            CheckoutProjectWithSSL(engine, path);
            ModifyLocalRepository(path);

            SvnUpdate task = new SvnUpdate();
            task.Username = "******";
            task.RepositoryPath = path;
            task.BuildEngine = engine;

            bool success = task.Execute();

            Assert.That(success, Is.True);
            AssertRepositoryNotUpdated(path);
        }