This is an archive of the discontinued Mercurial Phabricator instance.

extensions: fix up many many debug logs that use %r
ClosedPublic

Authored by durin42 on Oct 12 2018, 12:53 PM.

Details

Summary

This gets us a bunch closer on Python 3, but I'll still have to use a
ton of sad globs. A previous version of this patch tried to preserve
the %r formatting, but upon review Yuya noted that special characters
in extension names is very unlikely, so we can just use %s and not
sweat the quoting.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Oct 12 2018, 12:53 PM
indygreg requested changes to this revision.Oct 12 2018, 1:31 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
mercurial/extensions.py
178

Can't we just switch to %s?

181

Ditto.

200–202

Ditto.

254

Ditto.

This revision now requires changes to proceed.Oct 12 2018, 1:31 PM

Switching to %s loses some quotes I like having.

mercurial/extensions.py
178

That'll result in less quoting in the output, and I like having the quoting.

pulkit added a subscriber: pulkit.Oct 19 2018, 5:09 PM

How do we want to move forward with this?

  1. use pycompat.bytestr() as this patch does
  2. use '%s' and add quotes in the output

This is one the failure breaking python3-buildbot.

yuja added a subscriber: yuja.Oct 19 2018, 8:26 PM
  1. use pycompat.bytestr() as this patch does
  2. use '%s' and add quotes in the output

I think they can be just "... '%s'" given extension names are unlikely to
contain meta characters.

durin42 edited the summary of this revision. (Show Details)Oct 23 2018, 11:31 AM
durin42 updated this revision to Diff 12323.
This revision was automatically updated to reflect the committed changes.