changeset 39279:cb9cf42c902f

debugcommands: use openstorage() in debugindexdot And add test coverage for changelog and manifests. Differential Revision: https://phab.mercurial-scm.org/D4355
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 20 Aug 2018 21:01:05 +0000
parents 53e532007878
children da459d426c20
files mercurial/debugcommands.py tests/test-debugindexdot.t tests/test-fastannotate-hg.t
diffstat 3 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Tue Aug 14 16:28:21 2018 +0000
+++ b/mercurial/debugcommands.py	Mon Aug 20 21:01:05 2018 +0000
@@ -1178,7 +1178,7 @@
 def debugindexdot(ui, repo, file_=None, **opts):
     """dump an index DAG as a graphviz dot file"""
     opts = pycompat.byteskwargs(opts)
-    r = cmdutil.openrevlog(repo, 'debugindexdot', file_, opts)
+    r = cmdutil.openstorage(repo, 'debugindexdot', file_, opts)
     ui.write(("digraph G {\n"))
     for i in r:
         node = r.node(i)
--- a/tests/test-debugindexdot.t	Tue Aug 14 16:28:21 2018 +0000
+++ b/tests/test-debugindexdot.t	Mon Aug 20 21:01:05 2018 +0000
@@ -13,6 +13,24 @@
   $ HGMERGE=true hg merge -q
   $ hg ci -m merge -d '3 0'
 
+  $ hg debugindexdot -c
+  digraph G {
+  	-1 -> 0
+  	0 -> 1
+  	0 -> 2
+  	2 -> 3
+  	1 -> 3
+  }
+
+  $ hg debugindexdot -m
+  digraph G {
+  	-1 -> 0
+  	0 -> 1
+  	0 -> 2
+  	2 -> 3
+  	1 -> 3
+  }
+
   $ hg debugindexdot a
   digraph G {
   	-1 -> 0
--- a/tests/test-fastannotate-hg.t	Tue Aug 14 16:28:21 2018 +0000
+++ b/tests/test-fastannotate-hg.t	Mon Aug 20 21:01:05 2018 +0000
@@ -491,7 +491,7 @@
   > EOF
   $ hg debugsetparents 17 17
   $ hg --config extensions.legacyrepo=../legacyrepo.py  commit -m "baz:2"
-  $ hg debugindexdot .hg/store/data/baz.i
+  $ hg debugindexdot baz
   digraph G {
   	-1 -> 0
   	0 -> 1
@@ -523,7 +523,7 @@
   > EOF
   $ hg debugsetparents 19 18
   $ hg --config extensions.legacyrepo=../legacyrepo.py  commit -m "baz:4"
-  $ hg debugindexdot .hg/store/data/baz.i
+  $ hg debugindexdot baz
   digraph G {
   	-1 -> 0
   	0 -> 1