Patchwork [3,of,8,V2] fileset: build initial subset in fullmatchctx class

login
register
mail settings
Submitter Pierre-Yves David
Date March 6, 2017, 9:36 a.m.
Message ID <dcafd00afeb38478ea65.1488793010@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/18919/
State Accepted
Headers show

Comments

Pierre-Yves David - March 6, 2017, 9:36 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1422093362 -32400
#      Sat Jan 24 18:56:02 2015 +0900
# Node ID dcafd00afeb38478ea65a978b9ada91b4a6ac46b
# Parent  54b8e49c33610b648cff5cbee2c0b306c63a1ebd
# EXP-Topic filesetrev-func
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r dcafd00afeb3
fileset: build initial subset in fullmatchctx class

Patch

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -474,7 +474,7 @@  methods = {
 }
 
 class matchctx(object):
-    def __init__(self, ctx, subset=None, status=None):
+    def __init__(self, ctx, subset, status=None):
         self.ctx = ctx
         self.subset = subset
         self._status = status
@@ -501,7 +501,8 @@  class matchctx(object):
 class fullmatchctx(matchctx):
     """A match context where any files in any revisions should be valid"""
 
-    def __init__(self, ctx, subset=None, status=None):
+    def __init__(self, ctx, status=None):
+        subset = _buildsubset(ctx, status)
         super(fullmatchctx, self).__init__(ctx, subset, status)
 
 def _intree(funcs, tree):
@@ -540,8 +541,7 @@  def getfileset(ctx, expr):
     else:
         status = None
 
-    subset = _buildsubset(ctx, status)
-    return getset(fullmatchctx(ctx, subset, status), tree)
+    return getset(fullmatchctx(ctx, status), tree)
 
 def prettyformat(tree):
     return parser.prettyformat(tree, ('string', 'symbol'))