X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/52f3900c0c7dec8581fa907495a09c900a3d39d7..e4fc1f59f679b4f0b5c6805feaf9da0df2cd370f:/stgit/config.py diff --git a/stgit/config.py b/stgit/config.py index 66e9f41..a2e29bb 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -29,11 +29,14 @@ config = ConfigParser.RawConfigParser() config.add_section('stgit') config.set('stgit', 'autoresolved', 'no') config.set('stgit', 'smtpserver', 'localhost:25') -config.set('stgit', 'smtpdelay', '2') +config.set('stgit', 'smtpdelay', '5') +config.set('stgit', 'pullcmd', 'git-pull') config.set('stgit', 'merger', - 'diff3 -L local -L older -L remote -m -E ' \ + 'diff3 -L current -L ancestor -L patched -m -E ' \ '"%(branch1)s" "%(ancestor)s" "%(branch2)s" > "%(output)s"') config.set('stgit', 'keeporig', 'yes') +config.set('stgit', 'keepoptimized', 'no') +config.set('stgit', 'extensions', '.ancestor .current .patched') # Read the configuration files (if any) and override the default settings config.read('/etc/stgitrc') @@ -49,3 +52,23 @@ if config.has_option('stgit', 'pager'): if config.has_section('gitmergeonefile'): for option, value in config.items('gitmergeonefile'): config.set('stgit', option, value) + + +# cached extensions +__extensions = None + +def file_extensions(): + """Returns a dictionary with the conflict file extensions + """ + global __extensions + + if not __extensions: + cfg_ext = config.get('stgit', 'extensions').split() + if len(cfg_ext) != 3: + raise CmdException, '"extensions" configuration error' + + __extensions = { 'ancestor': cfg_ext[0], + 'current': cfg_ext[1], + 'patched': cfg_ext[2] } + + return __extensions