##// END OF EJS Templates
fileset: pretty print syntax tree in debug output
Yuya Nishihara -
r25255:ad1d2c95 default
parent child Browse files
Show More
@@ -2165,7 +2165,7 b' def debugfileset(ui, repo, expr, **opts)'
2165 2165 ctx = scmutil.revsingle(repo, opts.get('rev'), None)
2166 2166 if ui.verbose:
2167 2167 tree = fileset.parse(expr)
2168 ui.note(tree, "\n")
2168 ui.note(fileset.prettyformat(tree), "\n")
2169 2169
2170 2170 for f in ctx.getfileset(expr):
2171 2171 ui.write("%s\n" % f)
@@ -517,5 +517,8 b' def getfileset(ctx, expr):'
517 517
518 518 return getset(matchctx(ctx, subset, status), tree)
519 519
520 def prettyformat(tree):
521 return parser.prettyformat(tree, ('string', 'symbol'))
522
520 523 # tell hggettext to extract docstrings from these functions:
521 524 i18nfunctions = symbols.values()
@@ -16,15 +16,21 b''
16 16
17 17 Test operators and basic patterns
18 18
19 $ fileset a1
19 $ fileset -v a1
20 ('symbol', 'a1')
20 21 a1
21 $ fileset 'a*'
22 $ fileset -v 'a*'
23 ('symbol', 'a*')
22 24 a1
23 25 a2
24 $ fileset '"re:a\d"'
26 $ fileset -v '"re:a\d"'
27 ('string', 're:a\\d')
25 28 a1
26 29 a2
27 $ fileset 'a1 or a2'
30 $ fileset -v 'a1 or a2'
31 (or
32 ('symbol', 'a1')
33 ('symbol', 'a2'))
28 34 a1
29 35 a2
30 36 $ fileset 'a1 | a2'
General Comments 0
You need to be logged in to leave comments. Login now