Esempio n. 1
0
        public void ShouldImportTrunkAndBranchIfTrunkDoesNotExist()
        {
            Using.Directory("publishSvn", () =>
            Using.SvnRepo(url => 
            {
                File.WriteAllText("test.txt", "");

                var log = new TestLogger();
                var sourceControl = new SvnProvider(log, TimeSpan.FromSeconds(30));
                var publish = new PublishToSourceControl(sourceControl);
                publish.FromWorkingDirectory(".")
                    .WithMainline(url + "/trunk")
                    .WithCommitMessage("test")
                    .To(url + "/tags/v1");

                Assert.That(sourceControl.Exists(url + "/trunk/test.txt"), "not imported into trunk\n" + log.Contents);
                Assert.That(sourceControl.Exists(url + "/tags/v1/test.txt"), "not branched\n" + log.Contents);
            }));
        }
Esempio n. 2
0
        public void ShouldUpdateTrunkAndBranchWhenFileDeleted()
        {
            Using.Directory("publishSvn", () =>
            Using.SvnRepo(url =>
            {
                var log = new TestLogger();
                var sourceControl = new SvnProvider(log, TimeSpan.FromSeconds(30));
                Directory.CreateDirectory("import");
                File.WriteAllText(@"import\test.txt", "");
                sourceControl.Import("import", url + "/trunk", "");

                Directory.CreateDirectory("new");

                var publish = new PublishToSourceControl(sourceControl);
                publish.FromWorkingDirectory("new")
                    .WithMainline(url + "/trunk")
                    .WithCommitMessage("test")
                    .To(url + "/tags/v1");

                Assert.That(!sourceControl.Exists(url + "/trunk/test.txt"), "file not deleted in trunk\n" + log.Contents);
                Assert.That(!sourceControl.Exists(url + "/tags/v1/test.txt"), "file not deleted in branch\n" + log.Contents);
            }));
        }
Esempio n. 3
0
 private bool Publish(string workingDirectory)
 {
     CreateNewWorkingDirectory(workingDirectory);
     var logAdapter = new MSBuildLogAdapter(Log);
     var publish = new PublishToSourceControl(new SvnProvider(logAdapter, TimeSpan.FromSeconds(CommandTimeoutInSeconds)));
     publish.FromWorkingDirectory(workingDirectory)
         .WithMainline(TrunkUrl)
         .WithCommitMessage(CommitMessage)
         .To(PublishedUrl);
     return !logAdapter.HasErrors;
 }