[PATCH V2] py3: change explicit conversion from str to pycompat.bytestr

Martin von Zweigbergk martinvonz at google.com
Fri Mar 17 13:15:42 EDT 2017


On Fri, Mar 17, 2017 at 6:49 AM, Rishabh Madan <rishabhmadan96 at gmail.com>
wrote:

> Sorry. I didn't know that changing the changeset message for V2 forwards
> it as a different stream.
>>
> On Fri, Mar 17, 2017 at 7:14 PM, Rishabh Madan <rishabhmadan96 at gmail.com>
> wrote:
>
>> # HG changeset patch
>> # User Rishabh Madan <rishabhmadan96 at gmail.com>
>> # Date 1489758142 -19800
>> #      Fri Mar 17 19:12:22 2017 +0530
>> # Node ID 3d6d9294e2247316541942c4bec5186cb5772cd6
>> # Parent  a5bad127128d8f60060be53d161acfa7a32a17d5
>> py3: change explicit conversion from str to pycompat.bytestr
>>
>> diff -r a5bad127128d -r 3d6d9294e224 mercurial/commands.py
>> --- a/mercurial/commands.py     Wed Mar 15 15:48:57 2017 -0700
>> +++ b/mercurial/commands.py     Fri Mar 17 19:12:22 2017 +0530
>> @@ -1813,7 +1813,7 @@
>>      matched = False
>>      for section, name, value in ui.walkconfig(untrusted=untrusted):
>>          source = ui.configsource(section, name, untrusted)
>> -        value = str(value)
>> +        value = pycompat.bytestr(value)
>>          if fm.isplain():
>>              source = source or 'none'
>>              value = value.replace('\n', '\\n')
>>
>
I thought I read that pycompat.bytestr-ness is not preserved by operations
(such as replace() on this line). If that's correct, will the above still
work if fm.isplain()?


>
>
>
> --
> Rishabh Madan
> Second Year Undergraduate student
> Indian Institute of Technology, Kharagpur
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170317/80d5272d/attachment.html>


More information about the Mercurial-devel mailing list