comparison mercurial/cmdutil.py @ 9654:96fe91be9c1e

walkchangerevs: yield contexts
author Matt Mackall <mpm@selenic.com>
date Sun, 25 Oct 2009 18:43:59 -0500
parents e4de75343743
children 6d7d3f849062
comparison
equal deleted inserted replaced
9653:e4de75343743 9654:96fe91be9c1e
1215 1215
1216 for i, window in increasing_windows(0, len(revs)): 1216 for i, window in increasing_windows(0, len(revs)):
1217 nrevs = [rev for rev in revs[i:i+window] if want(rev)] 1217 nrevs = [rev for rev in revs[i:i+window] if want(rev)]
1218 for rev in sorted(nrevs): 1218 for rev in sorted(nrevs):
1219 fns = fncache.get(rev) 1219 fns = fncache.get(rev)
1220 ctx = change(rev)
1220 if not fns: 1221 if not fns:
1221 def fns_generator(): 1222 def fns_generator():
1222 for f in change(rev).files(): 1223 for f in ctx.files():
1223 if match(f): 1224 if match(f):
1224 yield f 1225 yield f
1225 fns = fns_generator() 1226 fns = fns_generator()
1226 yield 'add', rev, fns 1227 yield 'add', ctx, fns
1227 for rev in nrevs: 1228 for rev in nrevs:
1228 yield 'iter', rev, None 1229 yield 'iter', change(rev), None
1229 return iterate() 1230 return iterate()
1230 1231
1231 def commit(ui, repo, commitfunc, pats, opts): 1232 def commit(ui, repo, commitfunc, pats, opts):
1232 '''commit the specified files or all outstanding changes''' 1233 '''commit the specified files or all outstanding changes'''
1233 date = opts.get('date') 1234 date = opts.get('date')