[PATCH] walkrepo: recurse only if ** in [paths] or [collections]

Ben benoit.allard at gmx.de
Tue Dec 9 02:44:24 CST 2008


[Adding CC to the list as it seems to have been forgotten]

On Mon, Dec 8, 2008 at 23:42, Dirkjan Ochtman <dirkjan at ochtman.nl> wrote:
> Thanks for working on this! I have some comments below.
>
> On 08/12/2008 22:21, Benoit Allard wrote:
>>
>> So the behavior is as follow:
>> collections: recursive discovery
>
> I think this should be non-recursive, as before.

We're having a political issue there as the release note for 1.1 is
mentioning recursive collections. As for now, path = '*' or '**' are
behaving recursively, the former could be considered as s bug and
corrected into flat discovery. But I'm afraid we'll have to keep the
CompatibilityRules on collections.

>
>> paths *: one level discovery
>> paths **: recursive discovery (same as collections)
>>
>> the mq repository (if any) is always shown
>
>> +                    if roottail == '*':
>> +                        recurse = False
>> +                    elif roottail == '**':
>> +                        recurse = True
>
> This is better written as {'*': False, '**': True}[tail].

good one !

>
>> -                    for path in util.walkrepos(roothead, followsym=True):
>> +                    for path in util.walkrepos(roothead, followsym=True,
>> +                                               recurse=recurse):
>
> Maybe put util.walkrepos() in a temp var to prevent the line continuation.
>
>> +hg --cwd a qinit --config extensions.hgext.mq= -c
>
> Weird whitespace?
>
>>
>>  hg init b
>>  echo b>  b/b
>> @@ -52,6 +53,7 @@
>>  t/a/=$root/a
>>  b=$root/b
>>  coll=$root/*
>> +rcoll=$root/**
>>  EOF
>
> Cheers,
>
> Dirkjan
>
>


More information about the Mercurial-devel mailing list