Mercurial > kallithea
changeset 8319:f8314738030a
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.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 03 Nov 2019 16:39:59 +0100 |
parents | 30e137b4ff18 |
children | 84487755bb2e |
files | scripts/i18n |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/i18n Thu Dec 19 20:47:55 2019 +0100 +++ b/scripts/i18n Sun Nov 03 16:39:59 2019 +0100 @@ -110,15 +110,18 @@ 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)