diff mercurial/util.py @ 6091:41aa0a37d9be

merge with main
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 14 Feb 2008 00:13:20 +0100
parents 152b6c5c1574 59a9dc9562e2
children 213ea6eed412
line wrap: on
line diff
--- a/mercurial/util.py	Wed Feb 13 19:34:28 2008 -0200
+++ b/mercurial/util.py	Thu Feb 14 00:13:20 2008 +0100
@@ -459,6 +459,8 @@
             return
         try:
             pat = '(?:%s)' % '|'.join([regex(k, p, tail) for (k, p) in pats])
+            if len(pat) > 20000:
+                raise OverflowError()
             return re.compile(pat).match
         except OverflowError:
             # We're using a Python with a tiny regex engine and we