basectx: move match from changectx
authorSean Farley <sean.michael.farley@gmail.com>
Mon, 05 Aug 2013 18:41:00 -0500
changeset 19563 87503cd824fa
parent 19562 389d7767630d
child 19564 f0ed47b73d37
basectx: move match from changectx
mercurial/context.py
--- a/mercurial/context.py	Mon Aug 05 18:40:36 2013 -0500
+++ b/mercurial/context.py	Mon Aug 05 18:41:00 2013 -0500
@@ -122,6 +122,12 @@
     def sub(self, path):
         return subrepo.subrepo(self, path)
 
+    def match(self, pats=[], include=None, exclude=None, default='glob'):
+        r = self._repo
+        return matchmod.match(r.root, r.getcwd(), pats,
+                              include, exclude, default,
+                              auditor=r.auditor, ctx=self)
+
 class changectx(basectx):
     """A changecontext object makes access to data related to a particular
     changeset convenient. It represents a read-only context already presnt in
@@ -383,12 +389,6 @@
             if match.bad(fn, _('no such file in rev %s') % self) and match(fn):
                 yield fn
 
-    def match(self, pats=[], include=None, exclude=None, default='glob'):
-        r = self._repo
-        return matchmod.match(r.root, r.getcwd(), pats,
-                              include, exclude, default,
-                              auditor=r.auditor, ctx=self)
-
     def diff(self, ctx2=None, match=None, **opts):
         """Returns a diff generator for the given contexts and matcher"""
         if ctx2 is None: