ui: optionally ignore sub-options from configitems()
For convenience.
--- a/mercurial/ui.py Sat Dec 05 20:20:57 2015 -0800
+++ b/mercurial/ui.py Sat Dec 05 20:24:39 2015 -0800
@@ -510,8 +510,14 @@
'''tell whether section exists in config.'''
return section in self._data(untrusted)
- def configitems(self, section, untrusted=False):
+ def configitems(self, section, untrusted=False, ignoresub=False):
items = self._data(untrusted).items(section)
+ if ignoresub:
+ newitems = {}
+ for k, v in items:
+ if ':' not in k:
+ newitems[k] = v
+ items = newitems.items()
if self.debugflag and not untrusted and self._reportuntrusted:
for k, v in self._ucfg.items(section):
if self._tcfg.get(section, k) != v: