Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.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 | 1bdbca0b6604 |
children | 32302480b402 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat Jun 18 16:52:51 2011 -0500 +++ b/mercurial/cmdutil.py Sat Jun 18 16:52:51 2011 -0500 @@ -234,7 +234,7 @@ def walkpat(pat): srcs = [] badstates = after and '?' or '?r' - m = scmutil.match(repo, [pat], opts, globbed=True) + m = scmutil.match(repo[None], [pat], opts, globbed=True) for abs in repo.walk(m): state = repo.dirstate[abs] rel = m.rel(abs) @@ -1185,7 +1185,8 @@ if opts.get('addremove'): scmutil.addremove(repo, pats, opts) - return commitfunc(ui, repo, message, scmutil.match(repo, pats, opts), opts) + return commitfunc(ui, repo, message, + scmutil.match(repo[None], pats, opts), opts) def commiteditor(repo, ctx, subs): if ctx.description():