changeset 38881:dec16c0cce50

fileset: move copy constructor of matchctx near __init__
author Yuya Nishihara <yuya@tcha.org>
date Sun, 22 Jul 2018 19:43:57 +0900
parents 80fd7371f2d8
children ff42ec7845e4
files mercurial/fileset.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fileset.py	Sun Jul 22 11:20:48 2018 +0900
+++ b/mercurial/fileset.py	Sun Jul 22 19:43:57 2018 +0900
@@ -462,6 +462,9 @@
         self._badfn = badfn
         self._status = None
 
+    def switch(self, basectx, ctx):
+        return matchctx(basectx, ctx, self._badfn)
+
     def withstatus(self, keys):
         """Create matchctx which has precomputed status specified by the keys"""
         mctx = matchctx(self._basectx, self.ctx, self._badfn)
@@ -528,9 +531,6 @@
         return matchmod.nevermatcher(repo.root, repo.getcwd(),
                                      badfn=self._badfn)
 
-    def switch(self, basectx, ctx):
-        return matchctx(basectx, ctx, self._badfn)
-
 def match(ctx, expr, badfn=None):
     """Create a matcher for a single fileset expression"""
     tree = filesetlang.parse(expr)