Esempio n. 1
0
 public void Version_IsOneOfTheSupportedOnes()
 {
     Assert.That(
         new[]
     {
         ClientExecutable.GetVersion()
     }, Is.SubsetOf(ClientExecutable.SupportedVersions));
 }
Esempio n. 2
0
 public void Remove_UncommittedFile_ThrowsMercurialExecutionException()
 {
     if (ClientExecutable.GetVersion() < new Version(1, 7, 0, 0))
     {
         Assert.Ignore("This is not reported as a problem in Mercurial <1.7");
     }
     Repo.Init();
     File.WriteAllText(Path.Combine(Repo.Path, "test.txt"), "contents");
     Repo.Add("test.txt");
     Assert.Throws <MercurialExecutionException>(() => Repo.Remove("test.txt"));
 }
Esempio n. 3
0
        public void Log_ForFileAndWithFollowOption_ShowsCompleteLogForFileIncludingBeforeRename()
        {
            if (ClientExecutable.GetVersion() < new Version(1, 7, 0, 0))
            {
                Assert.Ignore("This is not reported accurately in the log in Mercurial <1.7");
            }

            CommitAndRenameFile();

            Changeset[] log = Repo.Log(
                new LogCommand
            {
                FollowRenamesAndMoves = true,
                Path = "test2.txt",
            }).ToArray();

            Assert.That(log.Length, Is.EqualTo(2));
        }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MercurialHookBase"/> class.
 /// </summary>
 protected MercurialHookBase()
 {
     ClientExecutable.SetClientPath(Environment.GetEnvironmentVariable("HG"));
     _Repository = new Repository(Environment.CurrentDirectory, new NonPersistentClientFactory());
 }