Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 37500:8bb3899a0f47
formatter: make nested items somewhat readable in template output
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 15 Mar 2018 22:27:16 +0900 |
parents | aacfca6f9767 |
children | d110167610db |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Mar 18 23:36:52 2018 +0900 +++ b/mercurial/commands.py Thu Mar 15 22:27:16 2018 +0900 @@ -386,7 +386,7 @@ % ((pats and m.rel(abs)) or abs)) continue - fm = rootfm.nested('lines') + fm = rootfm.nested('lines', tmpl='{rev}: {line}') lines = fctx.annotate(follow=follow, skiprevs=skiprevs, diffopts=diffopts) if not lines: @@ -2506,7 +2506,7 @@ if not opts.get('text') and binary(): fm.plain(_(" Binary file matches")) else: - displaymatches(fm.nested('texts'), l) + displaymatches(fm.nested('texts', tmpl='{text}'), l) fm.plain(eol) found = True if opts.get('files_with_matches'): @@ -2848,7 +2848,7 @@ numoutput = ["%d" % p.rev() for p in parents] output.append("%s%s" % ('+'.join(numoutput), dirty)) - fn = fm.nested('parents') + fn = fm.nested('parents', tmpl='{rev}:{node|formatnode}', sep=' ') for p in parents: fn.startitem() fn.data(rev=p.rev()) @@ -5615,7 +5615,7 @@ names.append(name) vers.append(extensions.moduleversion(module) or None) isinternals.append(extensions.ismoduleinternal(module)) - fn = fm.nested("extensions") + fn = fm.nested("extensions", tmpl='{name}\n') if names: namefmt = " %%-%ds " % max(len(n) for n in names) places = [_("external"), _("internal")]