diff -r 996102be8b91 -r 44da63623fca mercurial/revset.py --- a/mercurial/revset.py Fri Aug 07 21:31:16 2015 +0900 +++ b/mercurial/revset.py Fri Aug 07 21:39:38 2015 +0900 @@ -2669,6 +2669,24 @@ tree = parse(spec, lookup) return _makematcher(ui, tree, repo) +def matchany(ui, specs, repo=None): + """Create a matcher that will include any revisions matching one of the + given specs""" + if not specs: + def mfunc(repo, subset=None): + return baseset() + return mfunc + if not all(specs): + raise error.ParseError(_("empty query")) + lookup = None + if repo: + lookup = repo.__contains__ + if len(specs) == 1: + tree = parse(specs[0], lookup) + else: + tree = ('or',) + tuple(parse(s, lookup) for s in specs) + return _makematcher(ui, tree, repo) + def _makematcher(ui, tree, repo): if ui: tree = findaliases(ui, tree, showwarning=ui.warn)