Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/grep.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 |
comparison
equal
deleted
inserted
replaced
45697:494642ed3c50 | 45698:41e0cbccb260 |
---|---|
88 | 88 |
89 self._matches = {} | 89 self._matches = {} |
90 self._copies = {} | 90 self._copies = {} |
91 self._skip = set() | 91 self._skip = set() |
92 self._revfiles = {} | 92 self._revfiles = {} |
93 | |
94 def _grepbody(self, fn, rev, body): | |
95 self._matches[rev].setdefault(fn, []) | |
96 m = self._matches[rev][fn] | |
97 if body is None: | |
98 return | |
99 | |
100 for lnum, cstart, cend, line in matchlines(body, self._regexp): | |
101 s = linestate(line, lnum, cstart, cend) | |
102 m.append(s) |