public void Phase_OfPushedChangeset_ChangesToPublic() { if (ClientExecutable.CurrentVersion < new Version(2, 1)) { Assert.Inconclusive("The phase command is not present in this Mercurial version"); } Repo1.Init(); File.WriteAllText(Path.Combine(Repo1.Path, "test1.txt"), "dummy content"); Repo1.AddRemove(); Repo1.Commit("Test"); Repo2.Init(); Repo1.Push(Repo2.Path); ChangesetPhase[] phases = null; try { phases = Repo1.Phase("0").ToArray(); } catch (Exception ex) { Console.WriteLine(ex); } CollectionAssert.AreEqual(new[] { new ChangesetPhase(0, Phases.Public), }, phases); }
public void Outgoing_UnrelatedRepositoryWithoutForce_ThrowsMercurialExecutionException() { Repo1.Init(); WriteTextFileAndCommit(Repo1, "test1.txt", "dummy", "dummy", true); Repo2.Init(); WriteTextFileAndCommit(Repo2, "test2.txt", "dummy", "dummy", true); Assert.Throws <MercurialExecutionException>(() => Repo2.Outgoing(Repo1.Path)); }
public void Bundle_UnrelatedDestinationRepository_ThrowsMercurialExecutionException() { Repo1.Init(); WriteTextFileAndCommit(Repo1, "test1.txt", "dummy", "dummy", true); Repo2.Init(); WriteTextFileAndCommit(Repo2, "test2.txt", "dummy", "dummy", true); Assert.Throws <MercurialExecutionException>(() => Repo1.Bundle(GetTempFileName(), Repo2.Path)); }
public void Outgoing_UnrelatedRepositoryWithForce_ReturnsCollectionOfChangesets() { const string commitMessage = "commit message in clone"; Repo1.Init(); WriteTextFileAndCommit(Repo1, "test1.txt", "dummy", "dummy", true); Repo2.Init(); WriteTextFileAndCommit(Repo2, "test2.txt", "dummy", commitMessage, true); Changeset[] outgoing = Repo2.Outgoing(Repo1.Path, new OutgoingCommand().WithForce()).ToArray(); Assert.That(outgoing.Length, Is.EqualTo(1)); Assert.That(outgoing[0].CommitMessage, Is.EqualTo(commitMessage)); }
public void Bundle_PulledIntoEmptyRepository_ProducesCloneOfSource() { string bundleFileName = GetTempFileName(); Repo1.Init(); WriteTextFileAndCommit(Repo1, "test1.txt", "dummy", "dummy", true); Repo2.Init(); Repo1.Bundle(bundleFileName, Repo2.Path); Repo2.Pull(bundleFileName); CollectionAssert.AreEqual(Repo1.Log(new LogCommand().WithIncludePathActions()), Repo2.Log(new LogCommand().WithIncludePathActions())); }
public void Bundle_DestinationIsEmpty_ProducesBundleFile() { string bundleFileName = GetTempFileName(); Repo1.Init(); WriteTextFileAndCommit(Repo1, "test1.txt", "dummy", "dummy", true); Repo2.Init(); Repo1.Bundle(bundleFileName, Repo2.Path); long length; using (var stream = new FileStream(bundleFileName, FileMode.Open)) { length = stream.Length; } Assert.That(length, Is.GreaterThan(0)); }
public void Outgoing_RepositoryWithNoDefaultDestination_ThrowsMercurialExecutionException() { Repo2.Init(); Assert.Throws <MercurialExecutionException>(() => Repo2.Outgoing()); }
public override void SetUp() { base.SetUp(); Repo1.Init(); Repo2.Init(); }