예제 #1
0
        public static SvnResultsBase SvnCopy(this ICakeContext context,
                                             string message,
                                             string sourcePath,
                                             string destinationPath,
                                             string taglabel,
                                             string username,
                                             string password)
        {
            SvnResultsBase results = new SvnResultsBase();
            SvnCopy        task    = new SvnCopy(context)
            {
                Username        = username,
                Password        = password,
                SourcePath      = sourcePath,
                DestinationPath = destinationPath,
                Message         = message
            };

            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);
        }
예제 #2
0
        public void SvnCopyExecute()
        {
            SvnCopy task = new SvnCopy();

            task.Message         = "Tagging";
            task.SourcePath      = "file:///d:/svn/trunk/path";
            task.DestinationPath = "file:///d:/svn/tags/release/path";
            string expectedCommand = "copy \"file:///d:/svn/trunk/path\" \"file:///d:/svn/tags/release/path\" --message \"Tagging\" --non-interactive --no-auth-cache";
            string actualCommand   = TaskUtility.GetToolTaskCommand(task);

            Assert.AreEqual(expectedCommand, actualCommand);
        }
예제 #3
0
        public void SvnCopyBuildTreeExecute()
        {
            var     context = new Cake.VersionReader.Tests.Fakes.FakeCakeContext().CakeContext;
            SvnCopy task    = new SvnCopy(context);

            task.Message         = "Tagging";
            task.SourcePath      = "file:///d:/svn/trunk/path";
            task.DestinationPath = "file:///d:/svn/tags/release/path";
            task.BuildTree       = true;
            string expectedCommand = "copy \"file:///d:/svn/trunk/path\" \"file:///d:/svn/tags/release/path\" --parents --message \"Tagging\" --non-interactive --no-auth-cache";
            string actualCommand   = TaskUtility.GetToolTaskCommand(task);

            Assert.AreEqual(expectedCommand, actualCommand);
        }