This is an archive of the discontinued Mercurial Phabricator instance.

py3: make debugindexstats output printing compatible
AbandonedPublic

Authored by pulkit on Oct 19 2018, 5:26 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

We use pycompat.bytestr() and to convert str to bytes and '%d' for ints instead
of '%s'.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Oct 19 2018, 5:26 PM
yuja added a subscriber: yuja.Oct 20 2018, 3:19 AM
  • a/mercurial/debugcommands.py

+++ b/mercurial/debugcommands.py
@@ -1172,7 +1172,7 @@

if not util.safehasattr(index, 'stats'):
    raise error.Abort(_('debugindexstats only works with native code'))
for k, v in sorted(index.stats().items()):
  • ui.write('%s: %s\n' % (k, v))

+ ui.write('%s: %d\n' % (pycompat.bytestr(k), v))

Bad luck, we're no longer able to use PyDict_SetItemString().

Can you add TODO comment here? This is a bug of the C extension, and sysstr()
should be removed if it get fixed.

pulkit abandoned this revision.Nov 13 2018, 9:02 AM

I remember reading @yuja patches which took care of it.