##// END OF EJS Templates
grep: use set instead of dict with dummy value...
Martin von Zweigbergk -
r41404:64bd6611 default draft
parent child Browse files
Show More
@@ -2925,7 +2925,7 b' def grep(ui, repo, pattern, *pats, **opt'
2925 fm.data(matched=False)
2925 fm.data(matched=False)
2926 fm.end()
2926 fm.end()
2927
2927
2928 skip = {}
2928 skip = set()
2929 revfiles = {}
2929 revfiles = {}
2930 match = scmutil.match(repo[None], pats, opts)
2930 match = scmutil.match(repo[None], pats, opts)
2931 found = False
2931 found = False
@@ -2954,7 +2954,7 b' def grep(ui, repo, pattern, *pats, **opt'
2954 if copy:
2954 if copy:
2955 copies.setdefault(rev, {})[fn] = copy
2955 copies.setdefault(rev, {})[fn] = copy
2956 if fn in skip:
2956 if fn in skip:
2957 skip[copy] = True
2957 skip.add(copy)
2958 continue
2958 continue
2959 files.append(fn)
2959 files.append(fn)
2960
2960
@@ -2983,16 +2983,16 b' def grep(ui, repo, pattern, *pats, **opt'
2983 copy = copies.get(rev, {}).get(fn)
2983 copy = copies.get(rev, {}).get(fn)
2984 if fn in skip:
2984 if fn in skip:
2985 if copy:
2985 if copy:
2986 skip[copy] = True
2986 skip.add(copy)
2987 continue
2987 continue
2988 pstates = matches.get(parent, {}).get(copy or fn, [])
2988 pstates = matches.get(parent, {}).get(copy or fn, [])
2989 if pstates or states:
2989 if pstates or states:
2990 r = display(fm, fn, ctx, pstates, states)
2990 r = display(fm, fn, ctx, pstates, states)
2991 found = found or r
2991 found = found or r
2992 if r and not diff and not all_files:
2992 if r and not diff and not all_files:
2993 skip[fn] = True
2993 skip.add(fn)
2994 if copy:
2994 if copy:
2995 skip[copy] = True
2995 skip.add(copy)
2996 del revfiles[rev]
2996 del revfiles[rev]
2997 # We will keep the matches dict for the duration of the window
2997 # We will keep the matches dict for the duration of the window
2998 # clear the matches dict once the window is over
2998 # clear the matches dict once the window is over
General Comments 0
You need to be logged in to leave comments. Login now