config: Don't pull in config defaults twice
authorGuido Günther <agx@sigxcpu.org>
Tue, 18 Feb 2014 21:54:41 +0000 (22:54 +0100)
committerGuido Günther <agx@sigxcpu.org>
Tue, 18 Feb 2014 22:07:27 +0000 (23:07 +0100)
This would otherwise overwrite values set in the legacy config sections.

Closes: #733759
gbp/config.py

index e465cede88d14c7ad20b3939e6e626b74d28a3b0..d4c0e5ad7a6a50aef09aad0f99a8939890489c5d 100644 (file)
@@ -330,7 +330,9 @@ class GbpOptionParser(OptionParser):
             for prefix in ['gbp', 'git']:
                 oldcmd = '%s-%s' % (prefix, self.command)
                 if parser.has_section(oldcmd):
-                    self.config.update(dict(parser.items(oldcmd, raw=True)))
+                    # Don't use items() until we got rid of the compat sections
+                    # since this pulls in the defaults again
+                    self.config.update(dict(parser._sections[cmd].items()))
             cmd = self.command
 
         # Update with command specific settings