# HG changeset patch # User Steve Borho # Date 1202351526 21600 # Node ID 63e0e57ab15768fe5d976a0aa03f6275a602afc7 # Parent 59a9dc9562e24d5e5890c7d957ef2b91cb12e8a0 filemerge: add 'checkchanged' merge tool property diff -r 59a9dc9562e2 -r 63e0e57ab157 contrib/mergetools.hgrc --- a/contrib/mergetools.hgrc Mon Feb 11 16:13:43 2008 -0600 +++ b/contrib/mergetools.hgrc Wed Feb 06 20:32:06 2008 -0600 @@ -28,6 +28,7 @@ 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 diff -r 59a9dc9562e2 -r 63e0e57ab157 doc/hgrc.5.txt --- a/doc/hgrc.5.txt Mon Feb 11 16:13:43 2008 -0600 +++ b/doc/hgrc.5.txt Wed Feb 06 20:32:06 2008 -0600 @@ -289,6 +289,10 @@ 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 diff -r 59a9dc9562e2 -r 63e0e57ab157 mercurial/filemerge.py --- a/mercurial/filemerge.py Mon Feb 11 16:13:43 2008 -0600 +++ b/mercurial/filemerge.py Wed Feb 06 20:32:06 2008 -0600 @@ -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 @@ 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)