Mercurial > hg
diff mercurial/templater.py @ 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 | 75c13343cf38 |
children | e887381e2976 |
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"""