Use ConfigParser for now
authorJelmer Vernooij <jelmer@samba.org>
Wed, 3 Mar 2010 01:30:39 +0000 (02:30 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 3 Mar 2010 01:30:39 +0000 (02:30 +0100)
ConfigParser is included in Python's standard library and ConfigObj doesn't generate git-compatible files anyway.

We'll need a custom parser at some point.

.

1  2 
NEWS
dulwich/repo.py

diff --cc NEWS
index 34fe29243829fa2f69eb54a1b2793fc098af2a56,1be0a21be9edd4cbdd289b4b672d107d4190d7f0..1446439cf5f7f59ffe83237cfad5d404a5b22464
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
    * Add a GitFile class that uses the same locking protocol for writes as 
      cgit. (Dave Borowitz)
  
 +  * Cope with forward slashes correctly in the index on Windows.
 +    (Jelmer Vernooij, #526793)
 +
   FEATURES
  
 -  * --without-speedups option to setup.py to allow building/installing 
 -    without the C extensions. (Hal Wine, Jelmer Vernooij)
 +  * --pure option to setup.py to allow building/installing without the C 
 +    extensions. (Hal Wine, Anatoly Techtonik, Jelmer Vernooij, #434326)
  
--  * Implement Repo.get_config(). (Jelmer Vernooij)
++  * Implement Repo.get_config(). (Jelmer Vernooij, Augie Fackler)
  
    * HTTP dumb and smart server. (Dave Borowitz)
  
diff --cc dulwich/repo.py
index 17559e8d5330dd8742c27cb7ecfd7f25eeb3d3f7,4ec75ad9595587c474b8adc15ba821f52b11ac20..924b68e0aedb6402d892eb12bd5823c4d09109b3
@@@ -671,8 -672,9 +671,11 @@@ class BaseRepo(object)
          return self.commit(sha).parents
  
      def get_config(self):
-         from configobj import ConfigObj
-         return ConfigObj(os.path.join(self._controldir, 'config'))
++        import ConfigParser
+         p = ConfigParser.RawConfigParser()
+         p.read(os.path.join(self._controldir, 'config'))
 -        return dict((section, dict(p.items(section))) for section in p.sections())
++        return dict((section, dict(p.items(section)))
++                    for section in p.sections())
  
      def commit(self, sha):
          return self._get_object(sha, Commit)