# HG changeset patch # User Mads Kiilerich # Date 2019-11-03 15:39:59 # Node ID f8314738030acb33612de960df046621fed43803 # Parent 30e137b4ff1858d8218d05d92ab666e9361a7dbe scripts/i18n: let 'normalized-merge' leave 3-way conflict markers in output file 3-way conflict markers in the output file can be convenient ... and they do no harm when merge tools like kdiff3 will overwrite output anyway. diff --git a/scripts/i18n b/scripts/i18n --- a/scripts/i18n +++ b/scripts/i18n @@ -110,15 +110,18 @@ def normalized_merge(local, base, other, ret = simplemerge.simplemerge(uimod.ui.load(), context.arbitraryfilectx(local.encode('utf-8')), context.arbitraryfilectx(base.encode('utf-8')), - context.arbitraryfilectx(other.encode('utf-8')) + context.arbitraryfilectx(other.encode('utf-8')), + label=[b'local', b'other', b'base'], + mode='merge', ) - shutil.copyfile(local, output) # simplemerge wrote to local + shutil.copyfile(local, output) # simplemerge wrote to local - either resolved or with conflict markers if ret: + shutil.copyfile(localkeep, local) basekeep = base + '.keep' otherkeep = other + '.keep' shutil.copyfile(base, basekeep) shutil.copyfile(other, otherkeep) - sys.stderr.write("Error: simple merge failed. Run a merge tool manually to resolve conflicts, then use 'hg resolve -m'.\n") + sys.stderr.write("Error: simple merge failed and %s is left with conflict markers. Resolve the conflics , then use 'hg resolve -m'.\n" % output) sys.stderr.write('Resolve with e.g.: kdiff3 %s %s %s -o %s\n' % (basekeep, localkeep, otherkeep, output)) sys.exit(ret)