debugcommands: use openstorage() in debugindexdot
And add test coverage for changelog and manifests.
Differential Revision: https://phab.mercurial-scm.org/D4355
--- 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