[PATCH 4 of 4 evolve-ext] py3: handle bytes/strings

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon May 2 11:03:19 EDT 2016



On 04/22/2016 05:14 PM, Yuya Nishihara wrote:
> On Wed, 20 Apr 2016 19:19:22 +0000, timeless wrote:
>> # HG changeset patch
>> # User timeless at gmail.com
>> # Date 1461178867 0
>> #      Wed Apr 20 19:01:07 2016 +0000
>> # Node ID 80fe1d921a06bd78395fb8b4ee572fafd71587a4
>> # Parent  5f3fbe0fb1f34de87e62e76de7e48e49993b60d5
>> # Available At https://bitbucket.org/timeless/mutable-history/
>> #              hg pull https://bitbucket.org/timeless/mutable-history/ -r 80fe1d921a06
>> py3: handle bytes/strings
>>
>> diff -r 5f3fbe0fb1f3 -r 80fe1d921a06 hgext/evolve.py
>> --- a/hgext/evolve.py	Wed Apr 20 19:00:13 2016 +0000
>> +++ b/hgext/evolve.py	Wed Apr 20 19:01:07 2016 +0000
>> @@ -1101,7 +1101,7 @@
>>       else:
>>           fn, opts, = entry
>>       deprecationwarning = _('%s have been deprecated in favor of %s\n') % (
>> -        oldalias, newalias)
>> +        oldalias.encode('utf-8'), newalias.encode('utf-8'))
> The caller should convert 'oldalias' and 'newalias' to bytes because almost
> all Mercurial functions expect bytes (py2-str) instead of py3-str (unicode).

+1 I would rather see the proper type passed in the first place instead 
of having some silent magic at work internally.

In my opinion, we don't plan to use unicode function name any time soon.

I've taken the rest of the series because "It's done" and "why not" but 
I don't see to much point in spending too time making evolve py3 
compatible for now. On the py3 effort we should focus on having core 
Mercurial working first before trying to have extension compatible too. 
Moreover, evolve content is meant to migrate into core so we can maybe 
take care of the compatibility when that happen ?

Cheers

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list