mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
filemerge: add 'checkchanged' merge tool property
This commit is contained in:
parent
7fb82b40e9
commit
a42f97b40e
@ -28,6 +28,7 @@ xxdiff.gui=True
|
||||
xxdiff.priority=-8
|
||||
|
||||
diffmerge.args=--nosplash --merge --title1=base --title2=local --title3=other $base $local $other
|
||||
diffmerge.checkchanged=True
|
||||
diffmerge.gui=True
|
||||
|
||||
p4merge.args=$base $local $other $output
|
||||
|
@ -289,6 +289,10 @@ merge-tools::
|
||||
Check whether there are conflicts even though the tool reported
|
||||
success.
|
||||
Default: False
|
||||
checkchanged;;
|
||||
Check whether outputs were written even though the tool reported
|
||||
success.
|
||||
Default: False
|
||||
fixeol;;
|
||||
Attempt to fix up EOL changes caused by the merge tool.
|
||||
Default: False
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
from node import *
|
||||
from i18n import _
|
||||
import util, os, tempfile, context, simplemerge, re
|
||||
import util, os, tempfile, context, simplemerge, re, filecmp
|
||||
|
||||
def _toolstr(ui, tool, part, default=""):
|
||||
return ui.config("merge-tools", tool + "." + part, default)
|
||||
@ -193,6 +193,13 @@ def filemerge(repo, fw, fd, fo, wctx, mctx):
|
||||
if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcm.data()):
|
||||
r = 1
|
||||
|
||||
if not r and _toolbool(ui, tool, "checkchanged"):
|
||||
if filecmp.cmp(repo.wjoin(fd), back):
|
||||
if ui.prompt(_(" output file %s appears unchanged\n"
|
||||
"was merge successful (yn)?") % fd,
|
||||
_("[yn]"), _("n")) != _("y"):
|
||||
r = 1
|
||||
|
||||
if _toolbool(ui, tool, "fixeol"):
|
||||
_matcheol(repo.wjoin(fd), back)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user