comparison mercurial/commands.py @ 29911: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 371c2a39eead
children 1c1c2bce2f97
comparison
equal deleted inserted replaced
29910:a043c6d372db 29911:b3ec902b2f3c
3517 """parse and apply a revision specification 3517 """parse and apply a revision specification
3518 3518
3519 Use --verbose to print the parsed tree before and after aliases 3519 Use --verbose to print the parsed tree before and after aliases
3520 expansion. 3520 expansion.
3521 """ 3521 """
3522 if ui.verbose: 3522 tree = revset.parse(expr, lookup=repo.__contains__)
3523 tree = revset.parse(expr, lookup=repo.__contains__) 3523 ui.note(revset.prettyformat(tree), "\n")
3524 ui.note(revset.prettyformat(tree), "\n") 3524 newtree = revset.expandaliases(ui, tree)
3525 newtree = revset.expandaliases(ui, tree) 3525 if newtree != tree:
3526 if newtree != tree: 3526 ui.note(("* expanded:\n"), revset.prettyformat(newtree), "\n")
3527 ui.note(("* expanded:\n"), revset.prettyformat(newtree), "\n") 3527 tree = newtree
3528 tree = newtree 3528 newtree = revset.foldconcat(tree)
3529 newtree = revset.foldconcat(tree) 3529 if newtree != tree:
3530 if newtree != tree: 3530 ui.note(("* concatenated:\n"), revset.prettyformat(newtree), "\n")
3531 ui.note(("* concatenated:\n"), revset.prettyformat(newtree), "\n") 3531 if opts["optimize"]:
3532 if opts["optimize"]: 3532 newtree = revset.analyze(newtree)
3533 newtree = revset.analyze(newtree) 3533 optimizedtree = revset.optimize(newtree)
3534 optimizedtree = revset.optimize(newtree) 3534 ui.note(("* optimized:\n"),
3535 ui.note(("* optimized:\n"), 3535 revset.prettyformat(optimizedtree), "\n")
3536 revset.prettyformat(optimizedtree), "\n") 3536
3537 func = revset.match(ui, expr, repo) 3537 func = revset.match(ui, expr, repo)
3538 revs = func(repo) 3538 revs = func(repo)
3539 if ui.verbose: 3539 if ui.verbose:
3540 ui.note(("* set:\n"), revset.prettyformatset(revs), "\n") 3540 ui.note(("* set:\n"), revset.prettyformatset(revs), "\n")
3541 for c in revs: 3541 for c in revs: