diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -1212,7 +1212,7 @@ groupsize = _BASE_SIZE for idx, r in enumerate(regexps): piecesize = len(r) - if (piecesize + 4) > MAX_RE_SIZE: + if (piecesize + _BASE_SIZE) > MAX_RE_SIZE: msg = _("matcher pattern is too long (%d bytes)") % piecesize raise error.Abort(msg) elif (groupsize + piecesize) > MAX_RE_SIZE: