mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
test_util: add helper to draw repo with graphlog extension
Priceless when debugging comprehensive tests
This commit is contained in:
parent
514c41a837
commit
e4a25fdc50
@ -19,6 +19,7 @@ from mercurial import hg
|
||||
from mercurial import i18n
|
||||
from mercurial import node
|
||||
from mercurial import ui
|
||||
from mercurial import extensions
|
||||
|
||||
from hgsubversion import util
|
||||
|
||||
@ -280,3 +281,21 @@ class TestBase(unittest.TestCase):
|
||||
if dest != source:
|
||||
copy = ctx[dest].renamed()
|
||||
self.assertEqual(copy[0], source)
|
||||
|
||||
def draw(self, repo):
|
||||
"""Helper function displaying a repository graph, especially
|
||||
useful when debugging comprehensive tests.
|
||||
"""
|
||||
# Could be more elegant, but it works with stock hg
|
||||
_ui = ui.ui()
|
||||
_ui.setconfig('extensions', 'graphlog', '')
|
||||
extensions.loadall(_ui)
|
||||
graphlog = extensions.find('graphlog')
|
||||
templ = """\
|
||||
changeset: {rev}:{node|short}
|
||||
branch: {branches}
|
||||
summary: {desc|firstline}
|
||||
files: {files}
|
||||
|
||||
"""
|
||||
graphlog.graphlog(_ui, repo, rev=None, template=templ)
|
||||
|
Loading…
Reference in New Issue
Block a user