comparison mercurial/commands.py @ 29921:a82e138d5249

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.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 21 Aug 2016 12:45:43 +0900
parents 770128405002
children ae933e3e2226
comparison
equal deleted inserted replaced
29920:e35a83cedde1 29921:a82e138d5249
3523 Use -p/--show-stage option to print the parsed tree at the given stages. 3523 Use -p/--show-stage option to print the parsed tree at the given stages.
3524 Use -p all to print tree at every stage. 3524 Use -p all to print tree at every stage.
3525 """ 3525 """
3526 stages = [ 3526 stages = [
3527 ('parsed', lambda tree: tree), 3527 ('parsed', lambda tree: tree),
3528 ('expanded', lambda tree: revset.expandaliases(ui, tree)), 3528 ('expanded',
3529 lambda tree: revset.expandaliases(ui, tree, showwarning=ui.warn)),
3529 ('concatenated', revset.foldconcat), 3530 ('concatenated', revset.foldconcat),
3530 ('analyzed', revset.analyze), 3531 ('analyzed', revset.analyze),
3531 ('optimized', revset.optimize), 3532 ('optimized', revset.optimize),
3532 ] 3533 ]
3533 stagenames = set(n for n, f in stages) 3534 stagenames = set(n for n, f in stages)
3558 if opts['show_stage'] or n != 'parsed': 3559 if opts['show_stage'] or n != 'parsed':
3559 ui.write(("* %s:\n") % n) 3560 ui.write(("* %s:\n") % n)
3560 ui.write(revset.prettyformat(tree), "\n") 3561 ui.write(revset.prettyformat(tree), "\n")
3561 printedtree = tree 3562 printedtree = tree
3562 3563
3563 func = revset.match(ui, expr, repo) 3564 func = revset.makematcher(tree)
3564 revs = func(repo) 3565 revs = func(repo)
3565 if ui.verbose: 3566 if ui.verbose:
3566 ui.note(("* set:\n"), revset.prettyformatset(revs), "\n") 3567 ui.note(("* set:\n"), revset.prettyformatset(revs), "\n")
3567 for c in revs: 3568 for c in revs:
3568 ui.write("%s\n" % c) 3569 ui.write("%s\n" % c)