##// END OF EJS Templates
filemerge: when not keeping premerge, don't write markers to context...
Martin von Zweigbergk -
r49600:86e4b86d default
parent child Browse files
Show More
@@ -411,7 +411,7 b' def _verifytext(input, ui):'
411 raise error.Abort(msg)
411 raise error.Abort(msg)
412
412
413
413
414 def _premerge(repo, local, other, base, toolconf, backup):
414 def _premerge(repo, local, other, base, toolconf):
415 tool, toolpath, binary, symlink, scriptfn = toolconf
415 tool, toolpath, binary, symlink, scriptfn = toolconf
416 if symlink or local.fctx.isabsent() or other.fctx.isabsent():
416 if symlink or local.fctx.isabsent() or other.fctx.isabsent():
417 return 1
417 return 1
@@ -445,15 +445,13 b' def _premerge(repo, local, other, base, '
445 merged_text, conflicts = simplemerge.simplemerge(
445 merged_text, conflicts = simplemerge.simplemerge(
446 ui, local, base, other, mode=mode
446 ui, local, base, other, mode=mode
447 )
447 )
448 # fcd.flags() already has the merged flags (done in
448 if not conflicts or premerge in validkeep:
449 # mergestate.resolve())
449 # fcd.flags() already has the merged flags (done in
450 local.fctx.write(merged_text, local.fctx.flags())
450 # mergestate.resolve())
451 local.fctx.write(merged_text, local.fctx.flags())
451 if not conflicts:
452 if not conflicts:
452 ui.debug(b" premerge successful\n")
453 ui.debug(b" premerge successful\n")
453 return 0
454 return 0
454 if premerge not in validkeep:
455 # restore from backup and try again
456 _restorebackup(local.fctx, backup)
457 return 1 # continue merging
455 return 1 # continue merging
458
456
459
457
@@ -879,12 +877,6 b' def partextras(labels):'
879 }
877 }
880
878
881
879
882 def _restorebackup(fcd, backup):
883 # TODO: Add a workingfilectx.write(otherfilectx) path so we can use
884 # util.copy here instead.
885 fcd.write(backup.data(), fcd.flags())
886
887
888 def _makebackup(repo, ui, wctx, fcd):
880 def _makebackup(repo, ui, wctx, fcd):
889 """Makes and returns a filectx-like object for ``fcd``'s backup file.
881 """Makes and returns a filectx-like object for ``fcd``'s backup file.
890
882
@@ -1123,7 +1115,6 b' def filemerge(repo, wctx, mynode, orig, '
1123 other,
1115 other,
1124 base,
1116 base,
1125 toolconf,
1117 toolconf,
1126 backup,
1127 )
1118 )
1128 # we're done if premerge was successful (r is 0)
1119 # we're done if premerge was successful (r is 0)
1129 if not r:
1120 if not r:
General Comments 0
You need to be logged in to leave comments. Login now