mercurial/config.py
changeset 8180 6fc30fe7f3e7
parent 8144 fca54469480e
child 8183 2858ab754995
--- a/mercurial/config.py	Sun Apr 26 16:50:43 2009 -0500
+++ b/mercurial/config.py	Sun Apr 26 16:50:43 2009 -0500
@@ -57,7 +57,7 @@
             self._data[section] = sortdict()
         self._data[section][item] = (value, source)
 
-    def read(self, path, fp):
+    def read(self, path, fp=None):
         sectionre = re.compile(r'\[([^\[]+)\]')
         itemre = re.compile(r'([^=\s]+)\s*=\s*(.*)')
         contre = re.compile(r'\s+(\S.*)')
@@ -66,6 +66,10 @@
         item = None
         line = 0
         cont = 0
+
+        if not fp:
+            fp = open(path)
+
         for l in fp:
             line += 1
             if cont: