D5351: match: use _BASE_SIZE instead of magic value 4
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Sun Dec 2 21:53:36 UTC 2018
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5351
AFFECTED FILES
mercurial/match.py
CHANGE DETAILS
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:
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list