[PATCH V2] status: add a flag to terse the output (issue4119)

Pulkit Goyal 7895pulkit at gmail.com
Mon Jun 19 17:51:11 EDT 2017


On Tue, Jun 20, 2017 at 3:14 AM, Martin von Zweigbergk
<martinvonz at google.com> wrote:
> On Mon, Jun 19, 2017 at 2:39 PM, Pulkit Goyal <7895pulkit at gmail.com> wrote:
>> On Tue, Jun 20, 2017 at 2:45 AM, Danek Duvall <danek.duvall at oracle.com> wrote:
>>> I'd like to see some text in the help output that talks about -t and its
>>> arguments -- what are they, what do they mean, what it means to combine
>>> them, how to disable them.
>>
>> Yeah that will be of great help to the users. Will add in V3 (or a followup).
>>
>>>> +                if st[0:1] in terse:
>>>> +                    show.append(st)
>>>
>>> Is there a reason you're using [0:1] here instead of simply [0]?
>>
>> Yes the reason is Python 3 because in that st[0] will return ascii value.
>>>>> a = b'abc'
>>>>> for i in range(len(a)):
>> ...     print(a[i])
>> ...
>> 97
>> 98
>> 99
>
> For the sake of correctness, "st[0] in terse" would also have worked,
> wouldn't it? st[0] would be a byte, but wouldn't terse be bytes too? I
> don't mind using st[0:1] for consistency, though.

Oops, sorry. I didn't know this before and lived in an illusion that
it won't work because of st[0] returning ascii value. I need to learn
about how this works. Thanks for correcting.


More information about the Mercurial-devel mailing list