##// END OF EJS Templates
merge: introduce tool.check parameter...
David Champion -
r11148:a912f267 default
parent child Browse files
Show More
@@ -463,13 +463,19 Supported arguments:
463 463 ``symlink``
464 464 This tool can merge symlinks. Defaults to False, even if tool was
465 465 selected by file pattern match.
466 ``checkconflicts``
467 Check whether there are conflicts even though the tool reported
468 success.
466 ``check``
467 A list of merge success-checking options:
468
469 ``changed``
470 Ask whether merge was successful when the merged file shows no changes.
471 ``conflicts``
472 Check whether there are conflicts even though the tool reported success.
473
474 ``checkchanged``
475 True is equivalent to ``check = changed``.
469 476 Default: False
470 ``checkchanged``
471 Check whether outputs were written even though the tool reported
472 success.
477 ``checkconflicts``
478 True is equivalent to ``check = conflicts``.
473 479 Default: False
474 480 ``fixeol``
475 481 Attempt to fix up EOL changes caused by the merge tool.
@@ -16,6 +16,9 def _toolstr(ui, tool, part, default="")
16 16 def _toolbool(ui, tool, part, default=False):
17 17 return ui.configbool("merge-tools", tool + "." + part, default)
18 18
19 def _toollist(ui, tool, part, default=[]):
20 return ui.configlist("merge-tools", tool + "." + part, default)
21
19 22 _internal = ['internal:' + s
20 23 for s in 'fail local other merge prompt dump'.split()]
21 24
@@ -223,11 +226,13 def filemerge(repo, mynode, orig, fcd, f
223 226 lambda x: '"%s"' % util.localpath(replace[x.group()[1:]]), args)
224 227 r = util.system(toolpath + ' ' + args, cwd=repo.root, environ=env)
225 228
226 if not r and _toolbool(ui, tool, "checkconflicts"):
229 if not r and (_toolbool(ui, tool, "checkconflicts") or
230 'conflicts' in _toollist(ui, tool, "check")):
227 231 if re.match("^(<<<<<<< .*|=======|>>>>>>> .*)$", fcd.data()):
228 232 r = 1
229 233
230 if not r and _toolbool(ui, tool, "checkchanged"):
234 if not r and (_toolbool(ui, tool, "checkchanged") or
235 'changed' in _toollist(ui, tool, "check")):
231 236 if filecmp.cmp(repo.wjoin(fd), back):
232 237 if ui.promptchoice(_(" output file %s appears unchanged\n"
233 238 "was merge successful (yn)?") % fd,
General Comments 0
You need to be logged in to leave comments. Login now