Mercurial > hg
changeset 36517:69477bac8926
log: do not invoke templatekw.showobsfate() as a function
Prepares for switching to the (context, mapping) API. I tried, but it appeared
not an one-off change to extract a non-template function from showobsfate(),
which deeply depends on the templater internals.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 25 Feb 2018 14:42:18 +0900 |
parents | 9e3c37c367af |
children | 7937850a523d |
files | mercurial/logcmdutil.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/logcmdutil.py Sun Feb 25 16:36:38 2018 +0900 +++ b/mercurial/logcmdutil.py Sun Feb 25 14:42:18 2018 +0900 @@ -278,7 +278,12 @@ self._showpatch(ctx) def _showobsfate(self, ctx): - obsfate = templatekw.showobsfate(repo=self.repo, ctx=ctx, ui=self.ui) + # TODO: do not depend on templater + tres = formatter.templateresources(self.repo.ui, self.repo) + t = formatter.maketemplater(self.repo.ui, '{join(obsfate, "\n")}', + defaults=templatekw.keywords, + resources=tres) + obsfate = t.render({'ctx': ctx, 'revcache': {}}).splitlines() if obsfate: for obsfateline in obsfate: