Mercurial > hg-stable
diff mercurial/templatekw.py @ 39639:34ecc0a09c76
formatter: populate ctx from repo and node value
This will basically replace the fm.contexthint() API. I originally thought
this would be too complicated, and I wrote 8399438bc7ef "formatter: provide
hint of context keys required by template" because of that. However, I had
to add a similar mechanism for fctx templates, and the overall machinery
became way simpler than my original patch.
The test output slightly changed as {author} is no longer available in
the {manifest} context, which isn't the point this test targeted on.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 07 Jun 2018 21:48:11 +0900 |
parents | 87428152e820 |
children | 94ca3579e84e |
line wrap: on
line diff
--- a/mercurial/templatekw.py Fri Sep 14 18:18:46 2018 -0400 +++ b/mercurial/templatekw.py Thu Jun 07 21:48:11 2018 +0900 @@ -481,8 +481,6 @@ mhex = hex(mnode) mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex}) f = context.process('manifest', mapping) - # TODO: perhaps 'ctx' should be dropped from mapping because manifest - # rev and node are completely different from changeset's. return templateutil.hybriditem(f, None, f, lambda x: {'rev': mrev, 'node': mhex})