1665 ui.writenoi18n(b"digraph G {\n") |
1664 ui.writenoi18n(b"digraph G {\n") |
1666 for i in r: |
1665 for i in r: |
1667 node = r.node(i) |
1666 node = r.node(i) |
1668 pp = r.parents(node) |
1667 pp = r.parents(node) |
1669 ui.write(b"\t%d -> %d\n" % (r.rev(pp[0]), i)) |
1668 ui.write(b"\t%d -> %d\n" % (r.rev(pp[0]), i)) |
1670 if pp[1] != nullid: |
1669 if pp[1] != repo.nullid: |
1671 ui.write(b"\t%d -> %d\n" % (r.rev(pp[1]), i)) |
1670 ui.write(b"\t%d -> %d\n" % (r.rev(pp[1]), i)) |
1672 ui.write(b"}\n") |
1671 ui.write(b"}\n") |
1673 |
1672 |
1674 |
1673 |
1675 @command(b'debugindexstats', []) |
1674 @command(b'debugindexstats', []) |
1676 def debugindexstats(ui, repo): |
1675 def debugindexstats(ui, repo): |
1677 """show stats related to the changelog index""" |
1676 """show stats related to the changelog index""" |
1678 repo.changelog.shortest(nullid, 1) |
1677 repo.changelog.shortest(repo.nullid, 1) |
1679 index = repo.changelog.index |
1678 index = repo.changelog.index |
1680 if not util.safehasattr(index, b'stats'): |
1679 if not util.safehasattr(index, b'stats'): |
1681 raise error.Abort(_(b'debugindexstats only works with native code')) |
1680 raise error.Abort(_(b'debugindexstats only works with native code')) |
1682 for k, v in sorted(index.stats().items()): |
1681 for k, v in sorted(index.stats().items()): |
1683 ui.write(b'%s: %d\n' % (k, v)) |
1682 ui.write(b'%s: %d\n' % (k, v)) |
2423 try: |
2422 try: |
2424 # We do not use revsingle/revrange functions here to accept |
2423 # We do not use revsingle/revrange functions here to accept |
2425 # arbitrary node identifiers, possibly not present in the |
2424 # arbitrary node identifiers, possibly not present in the |
2426 # local repository. |
2425 # local repository. |
2427 n = bin(s) |
2426 n = bin(s) |
2428 if len(n) != len(nullid): |
2427 if len(n) != repo.nodeconstants.nodelen: |
2429 raise TypeError() |
2428 raise TypeError() |
2430 return n |
2429 return n |
2431 except TypeError: |
2430 except TypeError: |
2432 raise error.InputError( |
2431 raise error.InputError( |
2433 b'changeset references must be full hexadecimal ' |
2432 b'changeset references must be full hexadecimal ' |