# HG changeset patch # User Martin von Zweigbergk # Date 1549836997 28800 # Node ID 1db5ae4b0ddad93dc0f34571ffc15a14ce29d2f9 # Parent c302218a2528ee61722d49ea428876cbb5a473ab cleanup: prefer matchmod.{always,never}() over accessing matchers directly We have these factory methods so we should use them. Differential Revision: https://phab.mercurial-scm.org/D5927 diff -r c302218a2528 -r 1db5ae4b0dda mercurial/changegroup.py --- a/mercurial/changegroup.py Sun Feb 10 14:16:33 2019 -0800 +++ b/mercurial/changegroup.py Sun Feb 10 14:16:37 2019 -0800 @@ -1313,9 +1313,9 @@ assert version in supportedoutgoingversions(repo) if matcher is None: - matcher = matchmod.alwaysmatcher(repo.root, '') + matcher = matchmod.always(repo.root, '') if oldmatcher is None: - oldmatcher = matchmod.nevermatcher(repo.root, '') + oldmatcher = matchmod.never(repo.root, '') if version == '01' and not matcher.always(): raise error.ProgrammingError('version 01 changegroups do not support ' diff -r c302218a2528 -r 1db5ae4b0dda mercurial/fileset.py --- a/mercurial/fileset.py Sun Feb 10 14:16:33 2019 -0800 +++ b/mercurial/fileset.py Sun Feb 10 14:16:37 2019 -0800 @@ -540,8 +540,7 @@ def never(self): """Create a matcher to select nothing""" repo = self.ctx.repo() - return matchmod.nevermatcher(repo.root, repo.getcwd(), - badfn=self._badfn) + return matchmod.never(repo.root, repo.getcwd(), badfn=self._badfn) def match(ctx, expr, badfn=None): """Create a matcher for a single fileset expression""" diff -r c302218a2528 -r 1db5ae4b0dda mercurial/subrepo.py --- a/mercurial/subrepo.py Sun Feb 10 14:16:33 2019 -0800 +++ b/mercurial/subrepo.py Sun Feb 10 14:16:37 2019 -0800 @@ -323,7 +323,7 @@ def matchfileset(self, expr, badfn=None): """Resolve the fileset expression for this repo""" - return matchmod.nevermatcher(self.wvfs.base, '', badfn=badfn) + return matchmod.never(self.wvfs.base, '', badfn=badfn) def printfiles(self, ui, m, fm, fmt, subrepos): """handle the files command for this subrepo"""