Mercurial > public > mercurial-scm > hg-stable
diff hgext/remotenames.py @ 37071:aa97e06a1912
templater: use template context to render old-style list template
Prepares for dropping the 'templ' resource.
This means old-style list templates are processed by the same engine class
as the one for the list node. I think that's fine since templates for the
same list should be tightly coupled, and I believe the extension point for
the engine classes isn't actually used.
Now templatekw._showlist() is a compatibility wrapper for _showcompatlist(),
and will be deprecated soon. The function is still marked as private since
I plan to change the interface to get rid of closures capturing context and
mapping.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 16 Mar 2018 22:47:15 +0900 |
parents | b710fdebd0db |
children | 9938992c5bae |
line wrap: on
line diff
--- a/hgext/remotenames.py Fri Mar 16 22:36:40 2018 +0900 +++ b/hgext/remotenames.py Fri Mar 16 22:47:15 2018 +0900 @@ -230,7 +230,7 @@ repo._remotenames.nodetobranch().get(node, [])) repo.names.addnamespace(remotebranchns) -@templatekeyword('remotenames', requires={'repo', 'ctx', 'templ'}) +@templatekeyword('remotenames', requires={'repo', 'ctx'}) def remotenameskw(context, mapping): """List of strings. Remote names associated with the changeset.""" repo = context.resource(mapping, 'repo') @@ -246,7 +246,7 @@ return templateutil.compatlist(context, mapping, 'remotename', remotenames, plural='remotenames') -@templatekeyword('remotebookmarks', requires={'repo', 'ctx', 'templ'}) +@templatekeyword('remotebookmarks', requires={'repo', 'ctx'}) def remotebookmarkskw(context, mapping): """List of strings. Remote bookmarks associated with the changeset.""" repo = context.resource(mapping, 'repo') @@ -259,7 +259,7 @@ return templateutil.compatlist(context, mapping, 'remotebookmark', remotebmarks, plural='remotebookmarks') -@templatekeyword('remotebranches', requires={'repo', 'ctx', 'templ'}) +@templatekeyword('remotebranches', requires={'repo', 'ctx'}) def remotebrancheskw(context, mapping): """List of strings. Remote branches associated with the changeset.""" repo = context.resource(mapping, 'repo')