diff tests/test_fetch_command.py @ 952:9c3b4f59e7e6

stupid: do not close branch upon branch-wide revert Reverting a branch with a remove followed by a copy results in a branch replacement. By default, branch replacements are handled by closing the replaced branch and committing the new branch on top of it. But we do not really want that when reverting a branch, we only want a linear history with a changeset capturing the revert.
author Patrick Mezard <patrick@mezard.eu>
date Tue, 16 Oct 2012 21:17:55 +0200
parents a80b01ceb1fc
children b729909d3793
line wrap: on
line diff
--- a/tests/test_fetch_command.py
+++ b/tests/test_fetch_command.py
@@ -237,6 +237,39 @@ class TestStupidPull(test_util.TestBase)
     def test_empty_repo_stupid(self):
         self.test_empty_repo(stupid=True)
 
+    def test_fetch_revert(self, stupid=False):
+        repo = self._load_fixture_and_fetch('revert.svndump', stupid=stupid)
+        graph = self.getgraph(repo)
+        refgraph = """\
+o  changeset: 3:937dcd1206d4
+|  branch:
+|  tags:      tip
+|  summary:   revert2
+|  files:     a dir/b
+|
+o  changeset: 2:9317a748b7c3
+|  branch:
+|  tags:
+|  summary:   revert
+|  files:     a dir/b
+|
+o  changeset: 1:243259a4138a
+|  branch:
+|  tags:
+|  summary:   changefiles
+|  files:     a dir/b
+|
+o  changeset: 0:ab86791fc857
+   branch:
+   tags:
+   summary:   init
+   files:     a dir/b
+"""
+        self.assertEqual(refgraph.strip(), graph.strip())
+
+    def test_fetch_revert_stupid(self):
+        self.test_fetch_revert(stupid=True)
+
 def suite():
     all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestBasicRepoLayout),
            unittest.TestLoader().loadTestsFromTestCase(TestStupidPull),