##// END OF EJS Templates
Speed up hg grep by avoiding useless manifest parsing...
Alexis S. L. Carvalho -
r6146:e3dd35d3 default
parent child Browse files
Show More
@@ -1072,19 +1072,19 b' def grep(ui, repo, pattern, *pats, **opt'
1072 if st == 'window':
1072 if st == 'window':
1073 matches.clear()
1073 matches.clear()
1074 elif st == 'add':
1074 elif st == 'add':
1075 mf = repo.changectx(rev).manifest()
1075 ctx = repo.changectx(rev)
1076 matches[rev] = {}
1076 matches[rev] = {}
1077 for fn in fns:
1077 for fn in fns:
1078 if fn in skip:
1078 if fn in skip:
1079 continue
1079 continue
1080 try:
1080 try:
1081 grepbody(fn, rev, getfile(fn).read(mf[fn]))
1081 grepbody(fn, rev, getfile(fn).read(ctx.filenode(fn)))
1082 fstate.setdefault(fn, [])
1082 fstate.setdefault(fn, [])
1083 if follow:
1083 if follow:
1084 copied = getfile(fn).renamed(mf[fn])
1084 copied = getfile(fn).renamed(ctx.filenode(fn))
1085 if copied:
1085 if copied:
1086 copies.setdefault(rev, {})[fn] = copied[0]
1086 copies.setdefault(rev, {})[fn] = copied[0]
1087 except KeyError:
1087 except revlog.LookupError:
1088 pass
1088 pass
1089 elif st == 'iter':
1089 elif st == 'iter':
1090 states = matches[rev].items()
1090 states = matches[rev].items()
General Comments 0
You need to be logged in to leave comments. Login now