mercurial/match.py
changeset 14674 1c151b963254
parent 14248 25c68ac247c1
child 14675 cfc89398f710
equal deleted inserted replaced
14673:b0566467c492 14674:1c151b963254
     9 import scmutil, util
     9 import scmutil, util
    10 from i18n import _
    10 from i18n import _
    11 
    11 
    12 class match(object):
    12 class match(object):
    13     def __init__(self, root, cwd, patterns, include=[], exclude=[],
    13     def __init__(self, root, cwd, patterns, include=[], exclude=[],
    14                  default='glob', exact=False, auditor=None):
    14                  default='glob', exact=False, auditor=None, ctx=None):
    15         """build an object to match a set of file patterns
    15         """build an object to match a set of file patterns
    16 
    16 
    17         arguments:
    17         arguments:
    18         root - the canonical root of the tree you're matching against
    18         root - the canonical root of the tree you're matching against
    19         cwd - the current working directory, if relevant
    19         cwd - the current working directory, if relevant
    35 
    35 
    36         self._root = root
    36         self._root = root
    37         self._cwd = cwd
    37         self._cwd = cwd
    38         self._files = []
    38         self._files = []
    39         self._anypats = bool(include or exclude)
    39         self._anypats = bool(include or exclude)
       
    40         self._ctx = ctx
    40 
    41 
    41         if include:
    42         if include:
    42             pats = _normalize(include, 'glob', root, cwd, auditor)
    43             pats = _normalize(include, 'glob', root, cwd, auditor)
    43             self.includepat, im = _buildmatch(pats, '(?:/|$)')
    44             self.includepat, im = _buildmatch(pats, '(?:/|$)')
    44         if exclude:
    45         if exclude: