changeset 29915:b3ec902b2f3c

debugrevspec: build parsed tree even if no --verbose specified Prepares for evaluating unoptimized tree. The output is suppressed by ui.note() anyway.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 21 Aug 2016 11:50:54 +0900
parents a043c6d372db
children 1c1c2bce2f97
files mercurial/commands.py
diffstat 1 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Sep 08 10:37:58 2016 +0200
+++ b/mercurial/commands.py	Sun Aug 21 11:50:54 2016 +0900
@@ -3519,21 +3519,21 @@
     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: