Mercurial > hg
changeset 37501:0f4de9c27973
templater: add public interface returning a set of resource keys
The next patch depends on knownresourcekeys(), and there's no reason to
keep availableresourcekeys() private.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 15 Mar 2018 21:09:37 +0900 |
parents | 8bb3899a0f47 |
children | 40c7347f6848 |
files | mercurial/templater.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templater.py Thu Mar 15 22:27:16 2018 +0900 +++ b/mercurial/templater.py Thu Mar 15 21:09:37 2018 +0900 @@ -644,6 +644,14 @@ v = self._defaults.get(key) return v + def availableresourcekeys(self, mapping): + """Return a set of available resource keys based on the given mapping""" + return self._resources.availablekeys(self, mapping) + + def knownresourcekeys(self): + """Return a set of supported resource keys""" + return self._resources.knownkeys() + def resource(self, mapping, key): """Return internal data (e.g. cache) used for keyword/function evaluation"""