Patchwork [1,of,4] debugrevspec: evaluate tree built by itself

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 12, 2016, 1:36 p.m.
Message ID <95164dd92394e896eaf0.1473687396@mimosa>
Download mbox | patch
Permalink /patch/16591/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 12, 2016, 1:36 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1471751143 -32400
#      Sun Aug 21 12:45:43 2016 +0900
# Node ID 95164dd92394e896eaf0632997ee1c187712c8de
# Parent  8a658b8b795aaea5e9fe34ae26a49b4656c594cb
debugrevspec: evaluate tree built by itself

Prepares for new option to evaluate an unoptimized tree.

Since a revset expression is no longer parsed twice, alias warnings should
be displayed at the first parsing stages. That's why showwarning=ui.warn is
added.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3525,7 +3525,8 @@  def debugrevspec(ui, repo, expr, **opts)
     """
     stages = [
         ('parsed', lambda tree: tree),
-        ('expanded', lambda tree: revset.expandaliases(ui, tree)),
+        ('expanded',
+         lambda tree: revset.expandaliases(ui, tree, showwarning=ui.warn)),
         ('concatenated', revset.foldconcat),
         ('analyzed', revset.analyze),
         ('optimized', revset.optimize),
@@ -3560,7 +3561,7 @@  def debugrevspec(ui, repo, expr, **opts)
             ui.write(revset.prettyformat(tree), "\n")
             printedtree = tree
 
-    func = revset.match(ui, expr, repo)
+    func = revset.makematcher(tree)
     revs = func(repo)
     if ui.verbose:
         ui.note(("* set:\n"), revset.prettyformatset(revs), "\n")