From c19dc3db115d85537dbdf0b4f12dc8b3bc9481c4 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Tue, 28 Mar 2006 22:01:02 +0100 Subject: [PATCH] The gitmergeonefile config section is deprecated Use [stgit] instead. For backward compatibility, also check the [gitmergeonefile] section. Signed-off-by: Catalin Marinas --- examples/stgitrc | 3 --- stgit/config.py | 12 ++++++++---- stgit/gitmergeonefile.py | 8 ++------ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/examples/stgitrc b/examples/stgitrc index f4facef..d9bd6ca 100644 --- a/examples/stgitrc +++ b/examples/stgitrc @@ -21,12 +21,9 @@ smtpserver: localhost:25 # variable, then default to using 'vi' #editor: /usr/bin/vi - -[gitmergeonefile] # Different three-way merge tools below. Uncomment the preferred one. # Note that the 'output' file contains the same data as 'branch1'. This # is useful for tools that do not take an output parameter - merger: diff3 -L local -L older -L remote -m -E \ "%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s" diff --git a/stgit/config.py b/stgit/config.py index 042af63..a124cb7 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -32,14 +32,18 @@ config = ConfigParser.RawConfigParser() config.add_section('stgit') config.set('stgit', 'autoresolved', 'no') config.set('stgit', 'smtpserver', 'localhost:25') - -config.add_section('gitmergeonefile') -config.set('gitmergeonefile', 'merger', +config.set('stgit', 'merger', 'diff3 -L local -L older -L remote -m -E ' \ '"%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s"') -config.set('gitmergeonefile', 'keeporig', 'yes') +config.set('stgit', 'keeporig', 'yes') # Read the configuration files (if any) and override the default settings config.read('/etc/stgitrc') config.read(os.path.expanduser('~/.stgitrc')) config.read(os.path.join(__git_dir, 'stgitrc')) + +# [gitmergeonefile] section is deprecated. In case it exists copy the +# options/values to the [stgit] one +if config.has_section('gitmergeonefile'): + for option, value in config.items('gitmergeonefile'): + config.set('stgit', option, value) diff --git a/stgit/gitmergeonefile.py b/stgit/gitmergeonefile.py index 586cef9..3b3175b 100644 --- a/stgit/gitmergeonefile.py +++ b/stgit/gitmergeonefile.py @@ -31,15 +31,11 @@ class GitMergeException(Exception): # Options # try: - merger = config.get('gitmergeonefile', 'merger') + merger = config.get('stgit', 'merger') + keeporig = config.get('stgit', 'keeporig') except Exception, err: raise GitMergeException, 'Configuration error: %s' % err -if config.has_option('gitmergeonefile', 'keeporig'): - keeporig = config.get('gitmergeonefile', 'keeporig') -else: - keeporig = 'yes' - # # Utility functions -- 2.11.0