From patchwork Sun Dec 14 06:27:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: match: make 'always' and 'exact' functions, not classes From: Martin von Zweigbergk X-Patchwork-Id: 7083 Message-Id: <48f76f52ab6eea77d160.1418538420@martinvonz.mtv.corp.google.com> To: mercurial-devel@selenic.com Date: Sat, 13 Dec 2014 22:27:00 -0800 # HG changeset patch # User Martin von Zweigbergk # Date 1414907809 25200 # Sat Nov 01 22:56:49 2014 -0700 # Node ID 48f76f52ab6eea77d1609ab6e17a7788ad0bf6f9 # Parent 495bc1b65d25872324a0220354f048b220304bd1 match: make 'always' and 'exact' functions, not classes There is no reason for classes 'always' and 'exact' not to be just functions that return instances the plain 'match' class. diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -156,13 +156,11 @@ - optimization might be possible and necessary.''' return self._always -class exact(match): - def __init__(self, root, cwd, files): - match.__init__(self, root, cwd, files, exact=True) +def exact(root, cwd, files): + return match(root, cwd, files, exact=True) -class always(match): - def __init__(self, root, cwd): - match.__init__(self, root, cwd, []) +def always(root, cwd): + return match(root, cwd, []) class narrowmatcher(match): """Adapt a matcher to work on a subdirectory only.