Mercurial > hg-stable
changeset 8585:bbcd0da50e96
match: redefine always and never in terms of match and exact
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 24 May 2009 02:56:14 -0500 |
parents | 0f06e72abfdc |
children | 347fe1ac4f21 |
files | mercurial/match.py |
diffstat | 1 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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]