This is an archive of the discontinued Mercurial Phabricator instance.

py3: handle keyword arguments correctly in hgext/patchbomb.py
ClosedPublic

Authored by pulkit on Oct 5 2017, 8:20 PM.

Details

Summary

The keys of keyword arguments must be str on Python 3 which is unicode. This
patch make sure we pass keyword arguments with keys are str everywhere in this
file and access the keys depending on whether they are bytes or str.

This patch uses pycompat.{byteskwargs|strkwargs} and somewhere it also added r''
to prevent transformer from adding a b'' over there.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Oct 5 2017, 8:20 PM
yuja requested changes to this revision.Oct 7 2017, 8:49 AM
yuja added a subscriber: yuja.

and missing import of pycompat. Please make sure all tests pass.

hgext/patchbomb.py
630

opts is modified here, but stropts isn't. Perhaps we shouldn't
keep the copy for long.

This revision now requires changes to proceed.Oct 7 2017, 8:49 AM
pulkit added a comment.EditedOct 7 2017, 1:27 PM
In D974#16430, @yuja wrote:

and missing import of pycompat. Please make sure all tests pass.

Oops, sorry. I am not sure how this one slipped in without passing tests. I will be more careful from now.

pulkit abandoned this revision.Oct 17 2017, 7:19 PM

Will revisit after the freeze.

yuja requested changes to this revision.Nov 4 2017, 3:39 AM
yuja added inline comments.
hgext/patchbomb.py
630

I think it's better to use a single bytes dict instead of managing
two copies carefully.

This revision now requires changes to proceed.Nov 4 2017, 3:39 AM
pulkit updated this revision to Diff 3376.Nov 9 2017, 9:05 AM
yuja accepted this revision.Nov 13 2017, 8:39 AM

Queued this, thanks.

This revision is now accepted and ready to land.Nov 13 2017, 8:39 AM
This revision was automatically updated to reflect the committed changes.