for prefix in ['gbp', 'git']:
oldcmd = '%s-%s' % (prefix, self.command)
if parser.has_section(oldcmd):
- # 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()))
+ self.config.update(dict(parser.items(oldcmd, raw=True)))
cmd = self.command
# Update with command specific settings
if parser.has_section(cmd):
self.config.update(dict(parser.items(cmd, 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()))
for section in self.sections:
if parser.has_section(section):
- self.config.update(dict(parser.items(section, raw=True)))
+ self.config.update(dict(parser._sections[section].items()))
else:
raise NoSectionError("Mandatory section [%s] does not exist."
% section)
>>> confname = os.path.join(tmpdir, 'gbp.conf')
>>> parser.config_files = [confname]
>>> f = open(confname, 'w')
- >>> f.write('[foo]\\nthere = is\\n[git-foo]\\nno = truth\\n')
+ >>> f.write('[DEFAULT]\\nthere = was\\n[foo]\\nthere = is\\n[git-foo]\\nno = truth\\n')
>>> f.close()
>>> parser._parse_config_files()
>>> parser.config['there']