diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2165,7 +2165,7 @@ def debugfileset(ui, repo, expr, **opts) ctx = scmutil.revsingle(repo, opts.get('rev'), None) if ui.verbose: tree = fileset.parse(expr) - ui.note(tree, "\n") + ui.note(fileset.prettyformat(tree), "\n") for f in ctx.getfileset(expr): ui.write("%s\n" % f) diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -517,5 +517,8 @@ def getfileset(ctx, expr): return getset(matchctx(ctx, subset, status), tree) +def prettyformat(tree): + return parser.prettyformat(tree, ('string', 'symbol')) + # tell hggettext to extract docstrings from these functions: i18nfunctions = symbols.values() diff --git a/tests/test-fileset.t b/tests/test-fileset.t --- a/tests/test-fileset.t +++ b/tests/test-fileset.t @@ -16,15 +16,21 @@ Test operators and basic patterns - $ fileset a1 + $ fileset -v a1 + ('symbol', 'a1') a1 - $ fileset 'a*' + $ fileset -v 'a*' + ('symbol', 'a*') a1 a2 - $ fileset '"re:a\d"' + $ fileset -v '"re:a\d"' + ('string', 're:a\\d') a1 a2 - $ fileset 'a1 or a2' + $ fileset -v 'a1 or a2' + (or + ('symbol', 'a1') + ('symbol', 'a2')) a1 a2 $ fileset 'a1 | a2'