# HG changeset patch # User Martin von Zweigbergk # Date 2018-12-02 21:45:20 # Node ID e115a6452b41503a62936191b6b2060aeee08756 # Parent 1e019f45fa88b142f47b3caa2ef5fc789a21d458 match: use _BASE_SIZE instead of magic value 4 Differential Revision: https://phab.mercurial-scm.org/D5351 diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -1212,7 +1212,7 @@ def _buildregexmatch(kindpats, globsuffi 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: