# HG changeset patch # User Gregory Szorc # Date 2016-06-26 02:10:46 # Node ID bcefb25acf52a961d946252e0b77ae94312e670e # Parent 526b027b0130b595ae84644d43a5d72660677389 revset: implement match() in terms of matchany() match() is the special case of a single element list being passed to matchany() with the additional error checking that the revset spec is defined. Change the implementation to remove the redundant code and have match() call matchany(). diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2528,13 +2528,10 @@ def posttreebuilthook(tree, repo): pass def match(ui, spec, repo=None): + """Create a matcher for a single revision spec.""" if not spec: raise error.ParseError(_("empty query")) - lookup = None - if repo: - lookup = repo.__contains__ - tree = parse(spec, lookup) - return _makematcher(ui, tree, repo) + return matchany(ui, [spec], repo=repo) def matchany(ui, specs, repo=None): """Create a matcher that will include any revisions matching one of the