# HG changeset patch # User Matt Mackall # Date 1243151774 18000 # Node ID bbcd0da50e960ee8fbaa7b30d8632de8ea086cea # Parent 0f06e72abfdcda6b179ef94dbc1b614158717a6e match: redefine always and never in terms of match and exact diff -r 0f06e72abfdc -r bbcd0da50e96 mercurial/match.py --- a/mercurial/match.py Sun May 24 02:56:14 2009 -0500 +++ b/mercurial/match.py Sun May 24 02:56:14 2009 -0500 @@ -35,18 +35,6 @@ 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 @@ _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]