Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/debugcommands.py @ 40365:4f37af86d5d5
debugcommands: avoid stack trace from debugindexstats in pure mode
This has been broken since I added it in d71e0ba34d9b (debugcommands:
add a debugindexstats command, 2018-08-08). This patch also fixes the
test.
Differential Revision: https://phab.mercurial-scm.org/D5152
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 18 Oct 2018 10:11:08 -0700 |
parents | 64360202d5b2 |
children | 24cb8a6d4c20 |
comparison
equal
deleted
inserted
replaced
40364:0a212b643277 | 40365:4f37af86d5d5 |
---|---|
1166 | 1166 |
1167 @command('debugindexstats', []) | 1167 @command('debugindexstats', []) |
1168 def debugindexstats(ui, repo): | 1168 def debugindexstats(ui, repo): |
1169 """show stats related to the changelog index""" | 1169 """show stats related to the changelog index""" |
1170 repo.changelog.shortest(nullid, 1) | 1170 repo.changelog.shortest(nullid, 1) |
1171 for k, v in sorted(repo.changelog.index.stats().items()): | 1171 index = repo.changelog.index |
1172 if not util.safehasattr(index, 'stats'): | |
1173 raise error.Abort(_('debugindexstats only works with native code')) | |
1174 for k, v in sorted(index.stats().items()): | |
1172 ui.write('%s: %s\n' % (k, v)) | 1175 ui.write('%s: %s\n' % (k, v)) |
1173 | 1176 |
1174 @command('debuginstall', [] + cmdutil.formatteropts, '', norepo=True) | 1177 @command('debuginstall', [] + cmdutil.formatteropts, '', norepo=True) |
1175 def debuginstall(ui, **opts): | 1178 def debuginstall(ui, **opts): |
1176 '''test Mercurial installation | 1179 '''test Mercurial installation |