Mercurial > public > mercurial-scm > hg-stable
diff hgext/hgk.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 | 525fdb738975 |
line wrap: on
line diff
--- a/hgext/hgk.py Sat Jun 18 16:52:51 2011 -0500 +++ b/hgext/hgk.py Sat Jun 18 16:52:51 2011 -0500 @@ -45,7 +45,7 @@ assert node2 is not None mmap = repo[node1].manifest() mmap2 = repo[node2].manifest() - m = scmutil.match(repo, files) + m = scmutil.match(repo[node1], files) modified, added, removed = repo.status(node1, node2, m)[:3] empty = short(nullid) @@ -81,7 +81,7 @@ if opts['patch']: if opts['pretty']: catcommit(ui, repo, node2, "") - m = scmutil.match(repo, files) + m = scmutil.match(repo[node1], files) chunks = patch.diff(repo, node1, node2, match=m, opts=patch.diffopts(ui, {'git': True})) for chunk in chunks: