[patch] syntax:plain for .hgignore

Jonathan S. Shapiro shap at eros-os.com
Fri Sep 14 10:57:00 CDT 2007


On Fri, 2007-09-14 at 16:42 +0200, Johannes Hofmann wrote:
> Just realized, that the culprit for the bad performance in our case
> is the '.*' that is added in front of each pattern by regex() in
> util.py.
> Using syntax:regexp and preceeding each fixed pattern with a '^'
> makes things fast.
> 
>   Johannes

This makes a sad sort of sense, and it suggests two things that we might
want to consider:

  1. Document this somewhere as an advisory hint.
  2. Consider an anchor syntax for globs if we don't already have one.

Offhand, it seems to me that a glob pattern starting with / can be
considered anchored. Failing that, we could augment the glob syntax by
permitting a leading ^ to indicate an anchor. In either case, we should
be sure to document the behavior someplace if that is not already done.

Other thoughts?

-- 
Jonathan S. Shapiro
Managing Director
The EROS Group, LLC
www.coyotos.org, www.eros-os.org



More information about the Mercurial-devel mailing list