The gitmergeonefile config section is deprecated
authorCatalin Marinas <catalin.marinas@gmail.com>
Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 28 Mar 2006 21:01:02 +0000 (22:01 +0100)
Use [stgit] instead. For backward compatibility, also check the
[gitmergeonefile] section.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
examples/stgitrc
stgit/config.py
stgit/gitmergeonefile.py

index f4facef..d9bd6ca 100644 (file)
@@ -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"
 
index 042af63..a124cb7 100644 (file)
@@ -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)
index 586cef9..3b3175b 100644 (file)
@@ -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