##// END OF EJS Templates
walkchangerev: use new match objects
Matt Mackall -
r6580:da2a20d2 default
parent child Browse files
Show More
@@ -977,11 +977,11 b' def walkchangerevs(ui, repo, pats, chang'
977 if windowsize < sizelimit:
977 if windowsize < sizelimit:
978 windowsize *= 2
978 windowsize *= 2
979
979
980 files, matchfn, anypats = matchpats(repo, pats, opts)
980 m = match(repo, pats, opts)
981 follow = opts.get('follow') or opts.get('follow_first')
981 follow = opts.get('follow') or opts.get('follow_first')
982
982
983 if repo.changelog.count() == 0:
983 if repo.changelog.count() == 0:
984 return [], matchfn
984 return [], m
985
985
986 if follow:
986 if follow:
987 defrange = '%s:0' % repo.changectx().rev()
987 defrange = '%s:0' % repo.changectx().rev()
@@ -989,10 +989,10 b' def walkchangerevs(ui, repo, pats, chang'
989 defrange = '-1:0'
989 defrange = '-1:0'
990 revs = revrange(repo, opts['rev'] or [defrange])
990 revs = revrange(repo, opts['rev'] or [defrange])
991 wanted = {}
991 wanted = {}
992 slowpath = anypats or opts.get('removed')
992 slowpath = m.anypats() or opts.get('removed')
993 fncache = {}
993 fncache = {}
994
994
995 if not slowpath and not files:
995 if not slowpath and not m.files():
996 # No files, no patterns. Display all revs.
996 # No files, no patterns. Display all revs.
997 wanted = dict.fromkeys(revs)
997 wanted = dict.fromkeys(revs)
998 copies = []
998 copies = []
@@ -1017,7 +1017,7 b' def walkchangerevs(ui, repo, pats, chang'
1017 if rev[0] < cl_count:
1017 if rev[0] < cl_count:
1018 yield rev
1018 yield rev
1019 def iterfiles():
1019 def iterfiles():
1020 for filename in files:
1020 for filename in m.files():
1021 yield filename, None
1021 yield filename, None
1022 for filename_node in copies:
1022 for filename_node in copies:
1023 yield filename_node
1023 yield filename_node
@@ -1056,7 +1056,7 b' def walkchangerevs(ui, repo, pats, chang'
1056 yield j, change(j)[3]
1056 yield j, change(j)[3]
1057
1057
1058 for rev, changefiles in changerevgen():
1058 for rev, changefiles in changerevgen():
1059 matches = filter(matchfn, changefiles)
1059 matches = filter(m, changefiles)
1060 if matches:
1060 if matches:
1061 fncache[rev] = matches
1061 fncache[rev] = matches
1062 wanted[rev] = 1
1062 wanted[rev] = 1
@@ -1109,7 +1109,7 b' def walkchangerevs(ui, repo, pats, chang'
1109 del wanted[x]
1109 del wanted[x]
1110
1110
1111 def iterate():
1111 def iterate():
1112 if follow and not files:
1112 if follow and not m.files():
1113 ff = followfilter(onlyfirst=opts.get('follow_first'))
1113 ff = followfilter(onlyfirst=opts.get('follow_first'))
1114 def want(rev):
1114 def want(rev):
1115 if ff.match(rev) and rev in wanted:
1115 if ff.match(rev) and rev in wanted:
@@ -1129,13 +1129,13 b' def walkchangerevs(ui, repo, pats, chang'
1129 if not fns:
1129 if not fns:
1130 def fns_generator():
1130 def fns_generator():
1131 for f in change(rev)[3]:
1131 for f in change(rev)[3]:
1132 if matchfn(f):
1132 if m(f):
1133 yield f
1133 yield f
1134 fns = fns_generator()
1134 fns = fns_generator()
1135 yield 'add', rev, fns
1135 yield 'add', rev, fns
1136 for rev in nrevs:
1136 for rev in nrevs:
1137 yield 'iter', rev, None
1137 yield 'iter', rev, None
1138 return iterate(), matchfn
1138 return iterate(), m
1139
1139
1140 def commit(ui, repo, commitfunc, pats, opts):
1140 def commit(ui, repo, commitfunc, pats, opts):
1141 '''commit the specified files or all outstanding changes'''
1141 '''commit the specified files or all outstanding changes'''
General Comments 0
You need to be logged in to leave comments. Login now