Patchwork [1,of,4] debugrevspec: build parsed tree even if no --verbose specified

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 8, 2016, 3:14 p.m.
Message ID <f3f3289bfa565f21e50b.1473347663@mimosa>
Download mbox | patch
Permalink /patch/16576/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 8, 2016, 3:14 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1471747854 -32400
#      Sun Aug 21 11:50:54 2016 +0900
# Node ID f3f3289bfa565f21e50b2f14d4ab4c6d0df349fd
# Parent  e20945831e4f9362d2e113bafe527e2a0554f4b4
debugrevspec: build parsed tree even if no --verbose specified

Prepares for evaluating unoptimized tree. The output is suppressed by
ui.note() anyway.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3519,21 +3519,21 @@  def debugrevspec(ui, repo, expr, **opts)
     Use --verbose to print the parsed tree before and after aliases
     expansion.
     """
-    if ui.verbose:
-        tree = revset.parse(expr, lookup=repo.__contains__)
-        ui.note(revset.prettyformat(tree), "\n")
-        newtree = revset.expandaliases(ui, tree)
-        if newtree != tree:
-            ui.note(("* expanded:\n"), revset.prettyformat(newtree), "\n")
-        tree = newtree
-        newtree = revset.foldconcat(tree)
-        if newtree != tree:
-            ui.note(("* concatenated:\n"), revset.prettyformat(newtree), "\n")
-        if opts["optimize"]:
-            newtree = revset.analyze(newtree)
-            optimizedtree = revset.optimize(newtree)
-            ui.note(("* optimized:\n"),
-                    revset.prettyformat(optimizedtree), "\n")
+    tree = revset.parse(expr, lookup=repo.__contains__)
+    ui.note(revset.prettyformat(tree), "\n")
+    newtree = revset.expandaliases(ui, tree)
+    if newtree != tree:
+        ui.note(("* expanded:\n"), revset.prettyformat(newtree), "\n")
+    tree = newtree
+    newtree = revset.foldconcat(tree)
+    if newtree != tree:
+        ui.note(("* concatenated:\n"), revset.prettyformat(newtree), "\n")
+    if opts["optimize"]:
+        newtree = revset.analyze(newtree)
+        optimizedtree = revset.optimize(newtree)
+        ui.note(("* optimized:\n"),
+                revset.prettyformat(optimizedtree), "\n")
+
     func = revset.match(ui, expr, repo)
     revs = func(repo)
     if ui.verbose: