parser.read(self.config_files)
self.config.update(dict(parser.defaults()))
- if not (self.command.startswith('gbp-') or
- self.command.startswith('git-')):
- # Invoked as gbp <command> syntax, so parse the old sections
- # of {gbp.git}-<command> for backward compatibility:
+ # Make sure we read any legacy sections prior to the real subcommands
+ # section i.e. read [gbp-pull] prior to [pull]
+ if (self.command.startswith('gbp-') or
+ self.command.startswith('git-')):
+ oldcmd = self.command
+ if parser.has_section(oldcmd):
+ self.config.update(dict(parser.items(oldcmd, raw=True)))
+ cmd = self.command[4:]
+ else:
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)))
+ cmd = self.command
# Update with command specific settings
- if parser.has_section(self.command):
- self.config.update(dict(parser.items(self.command, raw=True)))
+ if parser.has_section(cmd):
+ self.config.update(dict(parser.items(cmd, raw=True)))
for section in self.sections:
if parser.has_section(section):