Mercurial > hg > mercurial-source
changeset 33433:783394c0c978
match: simplify nevermatcher
Most of it does the same as its superclass, so it can simply be
removed. It also seems to make more sense for it to use relative
paths, as we do for everything except alwaysmatcher, although
nevermatcher.uipath() will probably never get called anyway, so it
won't matter.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 01 Jun 2017 08:31:21 -0700 |
parents | 7a209737f01c |
children | 9929af2b09b4 |
files | mercurial/match.py |
diffstat | 1 files changed, 3 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/match.py +++ b/mercurial/match.py @@ -153,8 +153,7 @@ listsubrepos=listsubrepos, badfn=badfn) else: # It's a little strange that no patterns means to match everything. - # Consider changing this to match nothing (probably adding a - # "nevermatcher"). + # Consider changing this to match nothing (probably using nevermatcher). m = alwaysmatcher(root, cwd, badfn) if include: @@ -345,18 +344,8 @@ class nevermatcher(basematcher): '''Matches nothing.''' - def __init__(self, root, cwd, badfn=None, relativeuipath=False): - super(nevermatcher, self).__init__(root, cwd, badfn, - relativeuipath=relativeuipath) - - def always(self): - return False - - def matchfn(self, f): - return False - - def visitdir(self, dir): - return False + def __init__(self, root, cwd, badfn=None): + super(nevermatcher, self).__init__(root, cwd, badfn) def __repr__(self): return '<nevermatcher>'