Patchwork [1,of,4,V2] revset: split post-parsing stage from match()

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 7, 2015, 2:45 p.m.
Message ID <1eb76318ec555ffd3b46.1438958744@mimosa>
Download mbox | patch
Permalink /patch/10130/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 7, 2015, 2:45 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1438950676 -32400
#      Fri Aug 07 21:31:16 2015 +0900
# Node ID 1eb76318ec555ffd3b465324988bf7880026241a
# Parent  b4a85ddadcb97ec8741720383e7490ac90a3be86
revset: split post-parsing stage from match()

_makematcher() will be reused by new matchany(ui, specs, repo=None) function
I'll add by the next patch.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2667,6 +2667,9 @@  def match(ui, spec, repo=None):
     if repo:
         lookup = repo.__contains__
     tree = parse(spec, lookup)
+    return _makematcher(ui, tree, repo)
+
+def _makematcher(ui, tree, repo):
     if ui:
         tree = findaliases(ui, tree, showwarning=ui.warn)
     tree = foldconcat(tree)