.hgignore crashes Mercurial
Matt Mackall
mpm at selenic.com
Sat Aug 18 12:39:13 CDT 2007
On Sat, Aug 18, 2007 at 06:43:31PM +0200, Guido Ostkamp wrote:
> Hello,
>
> for our huge project I have setup a .hgignore file of ~650 lines because
> of binaries and auto-generated files (those files either have no extension
> or I would select to many files by patterns).
What Python version and distribution are you using?
> Is this problem known? Is there a solution?
Apparently Python can be compiled with puny regex support and we don't
have a workaround yet. But here's a quick stab at one, lemme know if
it works:
diff -r c1dbc9ae8f2b mercurial/util.py
--- a/mercurial/util.py Fri Aug 17 00:35:16 2007 -0500
+++ b/mercurial/util.py Sat Aug 18 12:36:25 2007 -0500
@@ -477,6 +477,15 @@ def _matcher(canonroot, cwd, names, inc,
try:
pat = '(?:%s)' % '|'.join([regex(k, p, tail) for (k, p)
in pats])
return re.compile(pat).match
+ except OverflowError:
+ # We're using a Python with a tiny regex engine and we
+ # made it explode, so we'll divide the pattern list in two
+ # until it works
+ l = len(pats)
+ if l < 2:
+ raise
+ a, b = matchfn(pats[:l/2], tail), matchfn(pats[l/2:], tail)
+ return lambda s: a(s) or b(s)
except re.error:
for k, p in pats:
try:
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list