Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/debugcommands.py @ 51253:3551f2a1c963
debugindexstats: handle the lack of Rust support better
We don't have any stats in the Rust index. Currently it is not known which
stats would be interesting to get, so if they end up being important, we can
add them later.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Tue, 31 Oct 2023 18:09:43 +0100 |
parents | 786b6225793a |
children | 39f349391898 |
comparison
equal
deleted
inserted
replaced
51252:5807e3a8865e | 51253:3551f2a1c963 |
---|---|
1858 def debugindexstats(ui, repo): | 1858 def debugindexstats(ui, repo): |
1859 """show stats related to the changelog index""" | 1859 """show stats related to the changelog index""" |
1860 repo.changelog.shortest(repo.nullid, 1) | 1860 repo.changelog.shortest(repo.nullid, 1) |
1861 index = repo.changelog.index | 1861 index = repo.changelog.index |
1862 if not hasattr(index, 'stats'): | 1862 if not hasattr(index, 'stats'): |
1863 raise error.Abort(_(b'debugindexstats only works with native code')) | 1863 raise error.Abort(_(b'debugindexstats only works with native C code')) |
1864 for k, v in sorted(index.stats().items()): | 1864 for k, v in sorted(index.stats().items()): |
1865 ui.write(b'%s: %d\n' % (k, v)) | 1865 ui.write(b'%s: %d\n' % (k, v)) |
1866 | 1866 |
1867 | 1867 |
1868 @command(b'debuginstall', [] + cmdutil.formatteropts, b'', norepo=True) | 1868 @command(b'debuginstall', [] + cmdutil.formatteropts, b'', norepo=True) |