comparison mercurial/commands.py @ 25901:0203c50a589f

debugrevspec: pass lookup function to visualize fallback mechanism The next patch will move the exceptional parsing of old-style ranges to revset.tokenize(). This patch will allow us to see the result tree. Note that the parsing result of '-a-b-c-' is incorrect at this changeset. It will be fixed soon.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 18 Jul 2015 23:02:18 +0900
parents 4eb8d8a44bf1
children 9bbab9decd71
comparison
equal deleted inserted replaced
25899:c35ee1bbbbdc 25901:0203c50a589f
2931 2931
2932 Use --verbose to print the parsed tree before and after aliases 2932 Use --verbose to print the parsed tree before and after aliases
2933 expansion. 2933 expansion.
2934 """ 2934 """
2935 if ui.verbose: 2935 if ui.verbose:
2936 tree = revset.parse(expr) 2936 tree = revset.parse(expr, lookup=repo.__contains__)
2937 ui.note(revset.prettyformat(tree), "\n") 2937 ui.note(revset.prettyformat(tree), "\n")
2938 newtree = revset.findaliases(ui, tree) 2938 newtree = revset.findaliases(ui, tree)
2939 if newtree != tree: 2939 if newtree != tree:
2940 ui.note(revset.prettyformat(newtree), "\n") 2940 ui.note(revset.prettyformat(newtree), "\n")
2941 tree = newtree 2941 tree = newtree
2943 if newtree != tree: 2943 if newtree != tree:
2944 ui.note(revset.prettyformat(newtree), "\n") 2944 ui.note(revset.prettyformat(newtree), "\n")
2945 if opts["optimize"]: 2945 if opts["optimize"]:
2946 weight, optimizedtree = revset.optimize(newtree, True) 2946 weight, optimizedtree = revset.optimize(newtree, True)
2947 ui.note("* optimized:\n", revset.prettyformat(optimizedtree), "\n") 2947 ui.note("* optimized:\n", revset.prettyformat(optimizedtree), "\n")
2948 func = revset.match(ui, expr) 2948 func = revset.match(ui, expr, repo)
2949 revs = func(repo) 2949 revs = func(repo)
2950 if ui.verbose: 2950 if ui.verbose:
2951 ui.note("* set:\n", revset.prettyformatset(revs), "\n") 2951 ui.note("* set:\n", revset.prettyformatset(revs), "\n")
2952 for c in revs: 2952 for c in revs:
2953 ui.write("%s\n" % c) 2953 ui.write("%s\n" % c)