Example #1
0
        public void TestRevert()
        {
            string path = GetTemporaryPath();
            string file = Path.Combine(path, "foo");

            CommandClient.Initialize(path, MercurialPath);
            using (var client = new CommandClient(path, null, null, MercurialPath)) {
                File.WriteAllText(file, string.Empty);
                client.Add(file);
                client.Commit("Commit all");
                Assert.That(!client.Status().ContainsKey("foo"), "Default commit failed for foo");

                File.WriteAllText(file, "Modified!");
                Assert.That(client.Status().ContainsKey("foo"), "Failed to modify file");
                client.Revert(null, file);
                Assert.That(!client.Status().ContainsKey("foo"), "Revert failed for foo");
            }
        }