Mercurial > hg
comparison hgext/churn.py @ 14671:35c2cc322ba8
scmutil: switch match users to supplying contexts
The most appropriate context is not always clearly defined. The obvious cases:
For working directory commands, we use None
For commands (eg annotate) with single revs, we use that revision
The less obvious cases:
For commands (eg status, diff) with a pair of revs, we use the second revision
For commands that take a range (like log), we use None
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 18 Jun 2011 16:52:51 -0500 |
parents | a90131b85fd8 |
children | ce292f1379ba |
comparison
equal
deleted
inserted
replaced
14670:19197fa4c41c | 14671:35c2cc322ba8 |
---|---|
52 rate = {} | 52 rate = {} |
53 df = False | 53 df = False |
54 if opts.get('date'): | 54 if opts.get('date'): |
55 df = util.matchdate(opts['date']) | 55 df = util.matchdate(opts['date']) |
56 | 56 |
57 m = scmutil.match(repo, pats, opts) | 57 m = scmutil.match(repo[None], pats, opts) |
58 def prep(ctx, fns): | 58 def prep(ctx, fns): |
59 rev = ctx.rev() | 59 rev = ctx.rev() |
60 if df and not df(ctx.date()[0]): # doesn't match date format | 60 if df and not df(ctx.date()[0]): # doesn't match date format |
61 return | 61 return |
62 | 62 |