comparison mercurial/filemerge.py @ 48967:a54a866349ed stable

filemerge: when merge tool uses $output, don't leave markers in $local As explained in the previous patch, we incorrectly leave conflict markers in both `$local` and `$output` since D12190. I don't understand why it broke but the fix is simple and clear after all the recent refactoring. Differential Revision: https://phab.mercurial-scm.org/D12379
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 15 Mar 2022 13:31:39 -0700
parents f90337706ce7
children 4057563ebc6b
comparison
equal deleted inserted replaced
48966:b10a944c0486 48967:a54a866349ed
753 outpath = localpath 753 outpath = localpath
754 localoutputpath = backup.path() 754 localoutputpath = backup.path()
755 # Remove the .orig to make syntax-highlighting more likely. 755 # Remove the .orig to make syntax-highlighting more likely.
756 if localoutputpath.endswith(b'.orig'): 756 if localoutputpath.endswith(b'.orig'):
757 localoutputpath, ext = os.path.splitext(localoutputpath) 757 localoutputpath, ext = os.path.splitext(localoutputpath)
758 localdata = util.readfile(localpath) 758 files.append((b"local", localoutputpath, backup.data()))
759 files.append((b"local", localoutputpath, localdata))
760 759
761 with _maketempfiles(files) as temppaths: 760 with _maketempfiles(files) as temppaths:
762 basepath, otherpath = temppaths[:2] 761 basepath, otherpath = temppaths[:2]
763 if len(temppaths) == 3: 762 if len(temppaths) == 3:
764 localpath = temppaths[2] 763 localpath = temppaths[2]