comparison hgext/churn.py @ 9367:1ef630452e0b

cmdutil: use context objects for walkchangerevs()
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Thu, 20 Aug 2009 08:34:22 +0200
parents d7b6429c5ad4
children 7cca980317c5
comparison
equal deleted inserted replaced
9366:9ff178e7b627 9367:1ef630452e0b
51 rate = {} 51 rate = {}
52 df = False 52 df = False
53 if opts.get('date'): 53 if opts.get('date'):
54 df = util.matchdate(opts['date']) 54 df = util.matchdate(opts['date'])
55 55
56 get = util.cachefunc(lambda r: repo[r].changeset()) 56 get = util.cachefunc(lambda r: repo[r])
57 changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts) 57 changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
58 for st, rev, fns in changeiter: 58 for st, rev, fns in changeiter:
59
59 if not st == 'add': 60 if not st == 'add':
60 continue 61 continue
61 if df and not df(get(rev)[2][0]): # doesn't match date format 62
63 ctx = get(rev)
64 if df and not df(ctx.date()[0]): # doesn't match date format
62 continue 65 continue
63 66
64 ctx = repo[rev]
65 key = getkey(ctx) 67 key = getkey(ctx)
66 key = amap.get(key, key) # alias remap 68 key = amap.get(key, key) # alias remap
67 if opts.get('changesets'): 69 if opts.get('changesets'):
68 rate[key] = rate.get(key, 0) + 1 70 rate[key] = rate.get(key, 0) + 1
69 else: 71 else: