Mercurial > hg
changeset 40780:1e019f45fa88
match: make "groupsize" include the trailing "|"
I think this is a little easier to follow and it will simplify later
patches too.
Differential Revision: https://phab.mercurial-scm.org/D5350
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sun, 02 Dec 2018 13:44:49 -0800 |
parents | e8c992d56465 |
children | e115a6452b41 |
files | mercurial/match.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/match.py Sun Dec 02 13:09:43 2018 -0800 +++ b/mercurial/match.py Sun Dec 02 13:44:49 2018 -0800 @@ -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