Patchwork D5350: match: make "groupsize" include the trailing "|"

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

Comments

phabricator - Dec. 3, 2018, 10:55 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG1e019f45fa88: match: make &quot;groupsize&quot; include the trailing &quot;|&quot; (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5350?vs=12666&id=12670

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

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
@@ -1185,7 +1185,7 @@ 
         return regex, lambda f: any(mf(f) for mf in matchfuncs)
 
 MAX_RE_SIZE = 20000
-_BASE_SIZE = len('(?:)') - 1
+_BASE_SIZE = len('(?:)')
 
 def _joinregexes(regexps):
     """gather multiple regular expressions into a single one"""
@@ -1215,7 +1215,7 @@ 
             if (piecesize + 4) > MAX_RE_SIZE:
                 msg = _("matcher pattern is too long (%d bytes)") % piecesize
                 raise error.Abort(msg)
-            elif (groupsize + 1 + piecesize) > MAX_RE_SIZE:
+            elif (groupsize + piecesize) > MAX_RE_SIZE:
                 group = regexps[startidx:idx]
                 allgroups.append(_joinregexes(group))
                 startidx = idx