comparison mercurial/debugcommands.py @ 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 73cf21b2e8a6
children dd6bc2509bdc
comparison
equal deleted inserted replaced
39278:53e532007878 39279:cb9cf42c902f
1176 @command('debugindexdot', cmdutil.debugrevlogopts, 1176 @command('debugindexdot', cmdutil.debugrevlogopts,
1177 _('-c|-m|FILE'), optionalrepo=True) 1177 _('-c|-m|FILE'), optionalrepo=True)
1178 def debugindexdot(ui, repo, file_=None, **opts): 1178 def debugindexdot(ui, repo, file_=None, **opts):
1179 """dump an index DAG as a graphviz dot file""" 1179 """dump an index DAG as a graphviz dot file"""
1180 opts = pycompat.byteskwargs(opts) 1180 opts = pycompat.byteskwargs(opts)
1181 r = cmdutil.openrevlog(repo, 'debugindexdot', file_, opts) 1181 r = cmdutil.openstorage(repo, 'debugindexdot', file_, opts)
1182 ui.write(("digraph G {\n")) 1182 ui.write(("digraph G {\n"))
1183 for i in r: 1183 for i in r:
1184 node = r.node(i) 1184 node = r.node(i)
1185 pp = r.parents(node) 1185 pp = r.parents(node)
1186 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i)) 1186 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i))