summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-02-18 22:55:45 +0100
committerGuido Günther <agx@sigxcpu.org>2015-01-25 15:15:02 +0100
commit1d6c4c702bd8b5576d17217140d3eaf7c6d7ef29 (patch)
treebe278acdbf7d7013414002e8c59671caed3415c1 /gbp
parentbe16d2ebc6c6f13df05d79f4eb97e8e470529c93 (diff)
config: Deprecate legacy config sections
We deprecate sections starting with git- and gbp- to reduce the confusion about what gets parsed first.
Diffstat (limited to 'gbp')
-rw-r--r--gbp/config.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/gbp/config.py b/gbp/config.py
index 9469f0b..2ca7227 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -16,15 +16,18 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""handles command line and config file option parsing for the gbp commands"""
+import sys
from optparse import OptionParser, OptionGroup, Option, OptionValueError
from ConfigParser import SafeConfigParser, NoSectionError
from copy import copy
import os.path
+
try:
from gbp.version import gbp_version
except ImportError:
gbp_version = "[Unknown version]"
import gbp.tristate
+import gbp.log
from gbp.git import GitRepositoryError, GitRepository
no_upstream_branch_msg = """
@@ -385,16 +388,20 @@ class GbpOptionParser(OptionParser):
# section i.e. read [gbp-pull] prior to [pull]
if (self.command.startswith('gbp-') or
self.command.startswith('git-')):
+ cmd = self.command[4:]
oldcmd = self.command
if parser.has_section(oldcmd):
self.config.update(dict(parser.items(oldcmd, raw=True)))
- cmd = self.command[4:]
+ gbp.log.warn("Old style config section [%s] found "
+ "please rename to [%s]" % (oldcmd, cmd))
else:
+ cmd = self.command
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
+ gbp.log.warn("Old style config section [%s] found "
+ "please rename to [%s]" % (oldcmd, cmd))
# Update with command specific settings
if parser.has_section(cmd):