Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 50951:1cfc49e342c3
debugindexdot: migrate `opts` to native kwargs
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 21 Aug 2023 17:16:43 -0400 |
parents | 7825175d5ad5 |
children | 45a53fc82ab2 |
comparison
equal
deleted
inserted
replaced
50950:7825175d5ad5 | 50951:1cfc49e342c3 |
---|---|
1924 _(b'-c|-m|FILE'), | 1924 _(b'-c|-m|FILE'), |
1925 optionalrepo=True, | 1925 optionalrepo=True, |
1926 ) | 1926 ) |
1927 def debugindexdot(ui, repo, file_=None, **opts): | 1927 def debugindexdot(ui, repo, file_=None, **opts): |
1928 """dump an index DAG as a graphviz dot file""" | 1928 """dump an index DAG as a graphviz dot file""" |
1929 opts = pycompat.byteskwargs(opts) | 1929 r = cmdutil.openstorage( |
1930 r = cmdutil.openstorage(repo, b'debugindexdot', file_, opts) | 1930 repo, b'debugindexdot', file_, pycompat.byteskwargs(opts) |
1931 ) | |
1931 ui.writenoi18n(b"digraph G {\n") | 1932 ui.writenoi18n(b"digraph G {\n") |
1932 for i in r: | 1933 for i in r: |
1933 node = r.node(i) | 1934 node = r.node(i) |
1934 pp = r.parents(node) | 1935 pp = r.parents(node) |
1935 ui.write(b"\t%d -> %d\n" % (r.rev(pp[0]), i)) | 1936 ui.write(b"\t%d -> %d\n" % (r.rev(pp[0]), i)) |