Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 45698:41e0cbccb260
grep: move getbody() to grepsearcher class
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 09 Sep 2020 16:00:03 +0900 |
parents | 494642ed3c50 |
children | 888e633f0c1c |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Sep 09 15:56:40 2020 +0900 +++ b/mercurial/commands.py Wed Sep 09 16:00:03 2020 +0900 @@ -3404,16 +3404,6 @@ matches = searcher._matches copies = searcher._copies - def grepbody(fn, rev, body): - matches[rev].setdefault(fn, []) - m = matches[rev][fn] - if body is None: - return - - for lnum, cstart, cend, line in grepmod.matchlines(body, regexp): - s = grepmod.linestate(line, lnum, cstart, cend) - m.append(s) - uipathfn = scmutil.getuipathfn(repo) def display(fm, fn, ctx, pstates, states): @@ -3591,12 +3581,12 @@ files.append(fn) if fn not in matches[rev]: - grepbody(fn, rev, readfile(ctx, fn)) + searcher._grepbody(fn, rev, readfile(ctx, fn)) if diff: pfn = copy or fn if pfn not in matches[parent] and pfn in pctx: - grepbody(pfn, parent, readfile(pctx, pfn)) + searcher._grepbody(pfn, parent, readfile(pctx, pfn)) wopts = logcmdutil.walkopts( pats=pats,