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.
--- 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"""