diff tests/test_util.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 d6db289f1548
children 26aa0172725b
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -520,7 +520,7 @@ class TestBase(unittest.TestCase):
             msg = '%s\n%s' % (msg or '', diff)
             raise self.failureException, msg
 
-    def draw(self, repo):
+    def getgraph(self, repo):
         """Helper function displaying a repository graph, especially
         useful when debugging comprehensive tests.
         """
@@ -537,4 +537,10 @@ summary:   {desc|firstline}
 files:     {files}
 
 """
+        _ui.pushbuffer()
         graphlog.graphlog(_ui, repo, rev=None, template=templ)
+        return _ui.popbuffer()
+
+    def draw(self, repo):
+        sys.stdout.write(self.getgraph(repo))
+