[PATCH 26 of 36] context: move sub from changectx

Sean Farley sean.michael.farley at gmail.com
Wed Aug 7 13:13:26 CDT 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1375746036 18000
#      Mon Aug 05 18:40:36 2013 -0500
# Node ID 149a38e324edccb649d67d463ec13961a9814f4e
# Parent  1d9427f334e49bfe1bb5dd1b838357f89657a207
context: move sub from changectx

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -117,10 +117,13 @@
         try:
             return self._fileinfo(path)[1]
         except error.LookupError:
             return ''
 
+    def sub(self, path):
+        return subrepo.subrepo(self, path)
+
 class changectx(context):
     """A changecontext object makes access to data related to a particular
     changeset convenient. It represents a read-only context already presnt in
     the repo."""
     def __init__(self, repo, changeid=''):
@@ -372,13 +375,10 @@
                 # specified pattern is a directory
                 continue
             if match.bad(fn, _('no such file in rev %s') % self) and match(fn):
                 yield fn
 
-    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)


More information about the Mercurial-devel mailing list