- # save or remove the conflicts file
- if conflicts == []:
- os.remove(os.path.join(git.base_dir, 'conflicts'))
- else:
- f = file(os.path.join(git.base_dir, 'conflicts'), 'w+')
- f.writelines([line + '\n' for line in conflicts])
- f.close()
+ # resolved
+ try:
+ for filename in files:
+ if options.interactive:
+ interactive_merge(filename)
+ resolved(filename, options.reset)
+ del conflicts[conflicts.index(filename)]
+ finally:
+ # save or remove the conflicts file. Needs a finally clause to
+ # ensure that already solved conflicts are marked
+ if conflicts == []:
+ os.remove(os.path.join(basedir.get(), 'conflicts'))
+ else:
+ f = file(os.path.join(basedir.get(), 'conflicts'), 'w+')
+ f.writelines([line + '\n' for line in conflicts])
+ f.close()