--- a/mercurial/match.py Thu Nov 22 21:02:02 2018 +0100
+++ b/mercurial/match.py Thu Nov 22 17:41:10 2018 +0100
@@ -1201,7 +1201,7 @@
... ], '$')
Traceback (most recent call last):
...
- OverflowError
+ Abort: matcher pattern is too long (20009 bytes)
"""
try:
allgroups = []
@@ -1213,7 +1213,8 @@
for idx, r in enumerate(regexps):
piecesize = len(r)
if (piecesize + 4) > MAX_RE_SIZE:
- raise OverflowError
+ msg = _("matcher pattern is too long (%d bytes)") % piecesize
+ raise error.Abort(msg)
elif (groupsize + 1 + piecesize) > MAX_RE_SIZE:
group = regexps[startidx:idx]
allgroups.append(_joinregexes(group))