[PATCH 1 of 2] convert: Support glob exclude patterns

Martin Geisler mg at lazybytes.net
Wed Feb 3 03:01:35 CST 2010


Tessa Starkey <testarkey at gmail.com> writes:

> Thanks for the comments. Responses inline.
>
> On Tue, Feb 2, 2010 at 6:20 PM, Greg Ward <greg-hg at gerg.ca> wrote:
>
>> On Tue, Feb 2, 2010 at 2:07 PM, Tessa Starkey <testarkey at gmail.com> wrote:
>> > # HG changeset patch
>> > # User Tessa Starkey <testarkey at gmail.com>
>> > # Date 1265132627 18000
>> > # Node ID 052ab4a8d877c59c398a7ed2f52644387dc56d9b
>> > # Parent  d9aa5b368e36c10d2c29411772fef9fd339c2e9f
>> > convert: Support glob exclude patterns
>>
>> That sounds useful.
>>
>> > --- a/hgext/convert/__init__.py
>> > +++ b/hgext/convert/__init__.py
>> > @@ -84,15 +84,19 @@
>> >
>> >       exclude path/to/file
>> >
>> > +      glob_exclude path/to/file
>> > +
>>
>> Why does this require a new command?  Is there something wrong with
>> supporting globs in the existing 'exclude' command?
>>
>     The reason that glob_exclude is a separate command is to
> distinguish between entries that use the characters '*' and '?' as
> wildcards and file names that actually contain these characters. On
> the off chance that someone actually names a file '*.py', they can
> exclude that file without exlcuding all .py files.

I also dislike all these mini-languages that have weird limitations.

Like Matt, I suggest we use our standard functions from the match module
to handle these patterns and that we stick with a single 'exclude'
keyword. This mechanism already support escaping:

  % hg init
  % touch a.txt \?.txt
  % hg status
  ? ?.txt
  ? a.txt
  % hg status -X '?.txt'
  % hg status -X '\?.txt'
  ? a.txt

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


More information about the Mercurial-devel mailing list