Patchwork D5351: match: use _BASE_SIZE instead of magic value 4

login
register
mail settings
Submitter phabricator
Date Dec. 3, 2018, 10:56 a.m.
Message ID <703d1680ed40e294377774b73a316e50@localhost.localdomain>
Download mbox | patch
Permalink /patch/36918/
State Not Applicable
Headers show

Comments

phabricator - Dec. 3, 2018, 10:56 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe115a6452b41: match: use _BASE_SIZE instead of magic value 4 (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5351?vs=12667&id=12671

REVISION DETAIL
  https://phab.mercurial-scm.org/D5351

AFFECTED FILES
  mercurial/match.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

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: