X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/79df2f0df89f382b63e4122aa15099a257a06463..f7ed76a9b6158888e8efe2faef9c095802fd93fe:/stgit/commands/resolved.py diff --git a/stgit/commands/resolved.py b/stgit/commands/resolved.py index ae85f2b..1130641 100644 --- a/stgit/commands/resolved.py +++ b/stgit/commands/resolved.py @@ -23,6 +23,7 @@ from stgit.commands.common import * from stgit.utils import * from stgit import stack, git, basedir from stgit.config import config, file_extensions +from stgit.gitmergeonefile import interactive_merge help = 'mark a file conflict as solved' @@ -42,40 +43,6 @@ options = [make_option('-a', '--all', help = 'run the interactive merging tool', action = 'store_true')] -def interactive_merge(filename): - """Run the interactive merger on the given file - """ - try: - imerger = config.get('stgit', 'imerger') - except Exception, err: - raise CmdException, 'Configuration error: %s' % err - - extensions = file_extensions() - - ancestor = filename + extensions['ancestor'] - current = filename + extensions['current'] - patched = filename + extensions['patched'] - - # check whether we have all the files for a three-way merge - for fn in [filename, ancestor, current, patched]: - if not os.path.isfile(fn): - raise CmdException, \ - 'Cannot run the interactive merger: "%s" missing' % fn - - mtime = os.path.getmtime(filename) - - err = os.system(imerger % {'branch1': current, - 'ancestor': ancestor, - 'branch2': patched, - 'output': filename}) - - if err != 0: - raise CmdException, 'The interactive merger failed: %d' % err - if not os.path.isfile(filename): - raise CmdException, 'The "%s" file is missing' % filename - if mtime == os.path.getmtime(filename): - raise CmdException, 'The "%s" file was not modified' % filename - def func(parser, options, args): """Mark the conflict as resolved """