mercurial/fileset.py
changeset 38692 3700564c63fe
parent 38691 370ff3e34160
child 38758 774f92710a81
equal deleted inserted replaced
38691:370ff3e34160 38692:3700564c63fe
   611                                      badfn=self._badfn)
   611                                      badfn=self._badfn)
   612 
   612 
   613     def switch(self, ctx, status=None):
   613     def switch(self, ctx, status=None):
   614         return matchctx(ctx, status, self._badfn)
   614         return matchctx(ctx, status, self._badfn)
   615 
   615 
   616 class fullmatchctx(matchctx):
       
   617     """A match context where any files in any revisions should be valid"""
       
   618 
       
   619     def __init__(self, ctx, status=None, badfn=None):
       
   620         super(fullmatchctx, self).__init__(ctx, status, badfn)
       
   621     def switch(self, ctx, status=None):
       
   622         return fullmatchctx(ctx, status, self._badfn)
       
   623 
       
   624 # filesets using matchctx.switch()
   616 # filesets using matchctx.switch()
   625 _switchcallers = [
   617 _switchcallers = [
   626     'revs',
   618     'revs',
   627     'status',
   619     'status',
   628 ]
   620 ]
   641     return False
   633     return False
   642 
   634 
   643 def match(ctx, expr, badfn=None):
   635 def match(ctx, expr, badfn=None):
   644     """Create a matcher for a single fileset expression"""
   636     """Create a matcher for a single fileset expression"""
   645     tree = parse(expr)
   637     tree = parse(expr)
   646     mctx = fullmatchctx(ctx, _buildstatus(ctx, tree), badfn=badfn)
   638     mctx = matchctx(ctx, _buildstatus(ctx, tree), badfn=badfn)
   647     return getmatch(mctx, tree)
   639     return getmatch(mctx, tree)
   648 
   640 
   649 def _buildstatus(ctx, tree, basectx=None):
   641 def _buildstatus(ctx, tree, basectx=None):
   650     # do we need status info?
   642     # do we need status info?
   651 
   643