--- a/mercurial/config.py Sun Apr 26 16:50:43 2009 -0500
+++ b/mercurial/config.py Sun Apr 26 16:50:43 2009 -0500
@@ -27,7 +27,7 @@
dict.__delitem__(self, key)
self._list.remove(key)
-class config:
+class config(object):
def __init__(self, data=None):
self._data = {}
self._source = {}
@@ -39,6 +39,11 @@
return config(self)
def __contains__(self, section):
return section in self._data
+ def __getitem__(self, section):
+ return self._data.get(section, {})
+ def __iter__(self):
+ for d in self.sections():
+ yield d
def update(self, src, sections=None):
if not sections:
sections = src.sections()