# HG changeset patch # User Gregory Szorc # Date 2015-12-06 04:24:39 # Node ID f43988e5954c7a305dd928f0d3950adb784637f3 # Parent dccbebcff075f41cc4a380de5d43b3165adc4f08 ui: optionally ignore sub-options from configitems() For convenience. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -510,8 +510,14 @@ class ui(object): '''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: