Show More
@@ -3549,9 +3549,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||||
3549 | r = display(fm, fn, ctx, pstates, states) |
|
3549 | r = display(fm, fn, ctx, pstates, states) | |
3550 | found = found or r |
|
3550 | found = found or r | |
3551 | if r and not diff and not all_files: |
|
3551 | if r and not diff and not all_files: | |
3552 |
s |
|
3552 | searcher.skipfile(fn, rev) | |
3553 | if copy: |
|
|||
3554 | skip.add(copy) |
|
|||
3555 | del revfiles[rev] |
|
3553 | del revfiles[rev] | |
3556 | # We will keep the matches dict for the duration of the window |
|
3554 | # We will keep the matches dict for the duration of the window | |
3557 | # clear the matches dict once the window is over |
|
3555 | # clear the matches dict once the window is over |
@@ -107,6 +107,14 b' class grepsearcher(object):' | |||||
107 | self._skip = set() |
|
107 | self._skip = set() | |
108 | self._revfiles = {} |
|
108 | self._revfiles = {} | |
109 |
|
109 | |||
|
110 | def skipfile(self, fn, rev): | |||
|
111 | """Exclude the given file (and the copy at the specified revision) | |||
|
112 | from future search""" | |||
|
113 | copy = self._copies.get(rev, {}).get(fn) | |||
|
114 | self._skip.add(fn) | |||
|
115 | if copy: | |||
|
116 | self._skip.add(copy) | |||
|
117 | ||||
110 | def _grepbody(self, fn, rev, body): |
|
118 | def _grepbody(self, fn, rev, body): | |
111 | self._matches[rev].setdefault(fn, []) |
|
119 | self._matches[rev].setdefault(fn, []) | |
112 | m = self._matches[rev][fn] |
|
120 | m = self._matches[rev][fn] |
General Comments 0
You need to be logged in to leave comments.
Login now