[PATCH 1 of 3] Prevent command options from aliasing each other

Dan Villiom Podlaski Christiansen danchr at gmail.com
Mon Jul 6 16:12:17 CDT 2009


On 6 Jul 2009, at 22:37, Matt Mackall wrote:

> On Mon, 2009-07-06 at 13:22 +0000, Dan Villiom Podlaski Christiansen
> wrote:
>> # HG changeset patch
>> # User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
>> # Date 1246878985 -7200
>> # Node ID 96e8bf2fe345a6caa2f4627615b5f1fb3afd61bd
>> # Parent  95046688f80fbe481241ed3affeed205ce378b7e
>> Prevent command options from aliasing each other.
>>
>> This may lead to changes to options for one command inadvertently
>> affecting other commands.
>
> Confusing description. Might be better to just say: modifying an  
> option list without copying it first makes a mess.

Good point :)

> But that still leaves me puzzled. You've fixed the issue in  
> wrapcommand, so why do we need [] + foo in the various command table  
> entries? The right way to copy a list is list(foo).

I just followed the style of the existing code. (Another ‘[] +  
whatever’ was added in b9a8b616521d.[1])

The main reason for adding those was that I changed them before coming  
up with the fix for wrapcommand(). However, I still consider the  
changes useful; without them, explicitly modifying the cmdtable entry  
of one command could make a mess too…

[1] <http://www.selenic.com/hg/index.cgi/rev/b9a8b616521d>

--

Dan Villiom Podlaski Christiansen
danchr at gmail.com




More information about the Mercurial-devel mailing list