Mercurial > hg > mercurial-crew-with-dirclash
changeset 5208:cf9226452db7
Merge with -crew
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 20 Aug 2007 21:14:53 -0500 |
parents | 1108c952cca1 (diff) 212de429e000 (current diff) |
children | bbdcdc7f170e |
files | tests/test-add |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py +++ b/mercurial/util.py @@ -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: