[PATCH 1 of 2] convert: Support glob exclude patterns
Matt Mackall
mpm at selenic.com
Tue Feb 2 17:42:14 CST 2010
On Tue, 2010-02-02 at 18:20 -0500, Greg Ward 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?
I'm actually a little surprised to hear we don't already support globs
and/or regexes. Seems like we should be using some of our existing
matching functionality instead.
> > def rpairs(name):
> > + """ yields all suffix-prefix pairs of the given file path"""
> > e = len(name)
> > while e != -1:
> > - yield name[:e], name[e + 1:]
> > + yield name[:e], name[e+1:]
>
> Please avoid making cosmetic changes at the same time as adding
> functionality. As above, it makes the patch longer and harder to
> review.
This change will actually generate a complaint from check-code.
--
http://selenic.com : development and support for Mercurial and Linux
More information about the Mercurial-devel
mailing list