# HG changeset patch # User Matt Mackall # Date 2009-05-24 07:56:14 # Node ID bbcd0da50e960ee8fbaa7b30d8632de8ea086cea # Parent 0f06e72abfdcda6b179ef94dbc1b614158717a6e match: redefine always and never in terms of match and exact diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -35,18 +35,6 @@ class _match(object): def anypats(self): return self._anypats -class always(_match): - def __init__(self, root, cwd): - _match.__init__(self, root, cwd, [], lambda f: True, False) - -class never(_match): - def __init__(self, root, cwd): - _match.__init__(self, root, cwd, [], lambda f: False, False) - -class exact(_match): - def __init__(self, root, cwd, files): - _match.__init__(self, root, cwd, files, self.exact, False) - class match(_match): def __init__(self, root, cwd, patterns, include=[], exclude=[], default='glob'): @@ -108,6 +96,18 @@ class match(_match): _match.__init__(self, root, cwd, roots, m, anypats) +class exact(_match): + def __init__(self, root, cwd, files): + _match.__init__(self, root, cwd, files, self.exact, False) + +class always(match): + def __init__(self, root, cwd): + match.__init__(self, root, cwd, []) + +class never(exact): + def __init__(self, root, cwd): + exact.__init__(self, root, cwd, []) + def patkind(pat): return _patsplit(pat, None)[0]