[PATCH] convert: support glob patterns to exclude/include files

Tessa Starkey testarkey at gmail.com
Tue Mar 23 10:18:49 CDT 2010


On Sun, Mar 14, 2010 at 3:31 PM, Tessa Starkey <testarkey at gmail.com> wrote:
> On Fri, Mar 12, 2010 at 3:45 PM, Patrick Mézard <pmezard at gmail.com> wrote:
>

>> 1- Why do you need self.root here? I think you can pass ''. The source path is usually meaningless, input paths will be relative to sink root.
>
> You're right, self.root is not needed here.
>
Never mind that, when I change the root to ".", it aborts with: '
<filename> is not under root' .

>> 2- Reusing match.match() is a good idea with one problem, for some reason glob and relpath expressions are filtered through util.canonpath() which forbids anything containing a path component equal to '.hg'. Rerun your tests with an additional rule like:
>>
>>    exclude .hg/foobar
>>
>> It will fail to start. This might looks a completely uninteresting case, except a filemap feature is being added to hgsubversion just to filter out such a directory from Jython repository.
>
> I see two ways to handle this:
>
> a)  In  the fillemapper, have a special case for rules with '.hg' to
> work around the behaviour of match.

I haven't found a nice way.  It seems it would to lot of awkward code
just to handle this case.

> b) Add an option to match.match to accept paths  with .hg .
>
 I think this is this is the better way to approach this. However,
since this is a change to the main part, I think this should be
separate from  this patch to convert.   Adding an 'accept .hg' option
to match.match or canonpath may be something to pursue later as patch
all on its own.

- Tessa Starkey


More information about the Mercurial-devel mailing list