comparison mercurial/debugcommands.py @ 33336:4672db164c98

revset: make repo.anyrevs accept customized alias override (API) Previously repo.anyrevs only expand aliases in [revsetalias] config. This patch makes it more flexible to accept a customized dict defining aliases without having to couple with ui. revsetlang.expandaliases now has the signature (tree, aliases, warn=None) which is more consistent with templater.expandaliases. revsetlang.py is now free from "ui", which seems to be a good thing.
author Jun Wu <quark@fb.com>
date Sat, 24 Jun 2017 15:29:42 -0700
parents 68f3e819d41d
children 8056481caa81
comparison
equal deleted inserted replaced
33335:72f051f9a7d8 33336:4672db164c98
1958 1958
1959 Use --verify-optimized to compare the optimized result with the unoptimized 1959 Use --verify-optimized to compare the optimized result with the unoptimized
1960 one. Returns 1 if the optimized result differs. 1960 one. Returns 1 if the optimized result differs.
1961 """ 1961 """
1962 opts = pycompat.byteskwargs(opts) 1962 opts = pycompat.byteskwargs(opts)
1963 aliases = ui.configitems('revsetalias')
1963 stages = [ 1964 stages = [
1964 ('parsed', lambda tree: tree), 1965 ('parsed', lambda tree: tree),
1965 ('expanded', lambda tree: revsetlang.expandaliases(ui, tree)), 1966 ('expanded', lambda tree: revsetlang.expandaliases(tree, aliases,
1967 ui.warn)),
1966 ('concatenated', revsetlang.foldconcat), 1968 ('concatenated', revsetlang.foldconcat),
1967 ('analyzed', revsetlang.analyze), 1969 ('analyzed', revsetlang.analyze),
1968 ('optimized', revsetlang.optimize), 1970 ('optimized', revsetlang.optimize),
1969 ] 1971 ]
1970 if opts['no_optimized']: 1972 if opts['no_optimized']: