diff mercurial/scmutil.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 19197fa4c41c
children 785bbc8634f8
line wrap: on
line diff
--- a/mercurial/scmutil.py	Sat Jun 18 16:52:51 2011 -0500
+++ b/mercurial/scmutil.py	Sat Jun 18 16:52:51 2011 -0500
@@ -573,7 +573,7 @@
     m = ctx.match(pats, opts.get('include'), opts.get('exclude'),
                          default)
     def badfn(f, msg):
-        repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
+        ctx._repo.ui.warn("%s: %s\n" % (m.rel(f), msg))
     m.bad = badfn
     return m
 
@@ -591,7 +591,7 @@
     # we'd use status here, except handling of symlinks and ignore is tricky
     added, unknown, deleted, removed = [], [], [], []
     audit_path = pathauditor(repo.root)
-    m = match(repo, pats, opts)
+    m = match(repo[None], pats, opts)
     for abs in repo.walk(m):
         target = repo.wjoin(abs)
         good = True