[PATCH] pushkey: use False/True for return values from push functions
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Wed Jun 14 07:15:22 EDT 2017
On 06/13/2017 08:54 PM, Sean Farley wrote:
> Martin von Zweigbergk via Mercurial-devel
> <mercurial-devel at mercurial-scm.org> writes:
>
>> # HG changeset patch
>> # User Martin von Zweigbergk <martinvonz at google.com>
>> # Date 1497310557 25200
>> # Mon Jun 12 16:35:57 2017 -0700
>> # Node ID 984cdd0844fecb6c56d570236b03c999c4d485cf
>> # Parent f40eec7af04416521543b284fc6fa5365dbef611
>> pushkey: use False/True for return values from push functions
>>
>> It was particularly unclear in phases.pushphase() whether the 0/1
>> returned were the 0/1 for public/draft phase or for False/True
>
> Looks good to me; queued!
I'm not sure this is a good idea, the pushkey return treated as an
integer everywhere in the code, including the bit handling phases. Using
"True/False" works because they are also integers but that does not feel
like a good idea to me.
code using phases should use the explicit name (phases.public,
phases.draft) and I think we should rather make sure of this than using
explicit integer in the integer space.
(I do not have a too strong opinion about that)
Cheers
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list