comparison mercurial/debugcommands.py @ 39981:d71e0ba34d9b

debugcommands: add a debugindexstats command Someone went through the trouble of recording these stats, so let's make them accessible. Differential Revision: https://phab.mercurial-scm.org/D4832
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 08 Aug 2018 23:17:16 -0700
parents 36e9d2c60837
children 426cb2859013
comparison
equal deleted inserted replaced
39980:6bdee4bc181a 39981:d71e0ba34d9b
1162 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i)) 1162 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i))
1163 if pp[1] != nullid: 1163 if pp[1] != nullid:
1164 ui.write("\t%d -> %d\n" % (r.rev(pp[1]), i)) 1164 ui.write("\t%d -> %d\n" % (r.rev(pp[1]), i))
1165 ui.write("}\n") 1165 ui.write("}\n")
1166 1166
1167 @command('debugindexstats', [])
1168 def debugindexstats(ui, repo):
1169 """show stats related to the changelog index"""
1170 repo.changelog.shortest(nullid, 1)
1171 for k, v in sorted(repo.changelog.index.stats().items()):
1172 ui.write('%s: %s\n' % (k, v))
1173
1167 @command('debuginstall', [] + cmdutil.formatteropts, '', norepo=True) 1174 @command('debuginstall', [] + cmdutil.formatteropts, '', norepo=True)
1168 def debuginstall(ui, **opts): 1175 def debuginstall(ui, **opts):
1169 '''test Mercurial installation 1176 '''test Mercurial installation
1170 1177
1171 Returns 0 on success. 1178 Returns 0 on success.