# HG changeset patch # User Yuya Nishihara <y...@tcha.org> # Date 1521115777 -32400 # Thu Mar 15 21:09:37 2018 +0900 # Node ID a5029147b12caa69c76c5a4f9522e6b2c43ee5ae # Parent 8a79a82137c6a5af4d88e32ec6646db6539e6d60 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. diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -644,6 +644,14 @@ class engine(object): 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""" _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel