# HG changeset patch # User Martin von Zweigbergk # Date 2017-06-01 15:31:21 # Node ID 783394c0c97807e83daad9da561179bd0719e159 # Parent 7a209737f01ce0d153244fd36bb417edfd8a3039 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. diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -153,8 +153,7 @@ def match(root, cwd, patterns, include=N 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 alwaysmatcher(basematcher): 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 ''