[PATCH 2 of 5 changedelete] filemerge: return dirstate action from all other merge tools
Siddharth Agarwal
sid0 at fb.com
Thu Nov 5 02:11:59 CST 2015
# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1446705878 28800
# Wed Nov 04 22:44:38 2015 -0800
# Node ID db7ccd556b024d36f50765de8c2d8a08139e867a
# Parent 5f0d32c189f5a9e190b40cb0966fa5fc836ae23f
filemerge: return dirstate action from all other merge tools
This is required for change/delete conflicts -- see the previous patch for more.
diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -258,7 +258,7 @@ def _merge(repo, mynode, orig, fcd, fco,
ui = repo.ui
r = simplemerge.simplemerge(ui, a, b, c, label=labels, mode=mode)
- return True, r
+ return True, r, None
@internaltool('union', fullmerge,
_("warning: conflicts while merging %s! "
@@ -323,7 +323,7 @@ def _imergelocal(*args, **kwargs):
Like :merge, but resolve all conflicts non-interactively in favor
of the local changes."""
success, status = _imergeauto(localorother='local', *args, **kwargs)
- return success, status
+ return success, status, None
@internaltool('merge-other', mergeonly)
def _imergeother(*args, **kwargs):
@@ -331,7 +331,7 @@ def _imergeother(*args, **kwargs):
Like :merge, but resolve all conflicts non-interactively in favor
of the other changes."""
success, status = _imergeauto(localorother='other', *args, **kwargs)
- return success, status
+ return success, status, None
@internaltool('tagmerge', mergeonly,
_("automatic tag merging of %s failed! "
@@ -341,7 +341,8 @@ def _itagmerge(repo, mynode, orig, fcd,
"""
Uses the internal tag merge algorithm (experimental).
"""
- return tagmerge.merge(repo, fcd, fco, fca)
+ success, status = tagmerge.merge(repo, fcd, fco, fca)
+ return success, status, None
@internaltool('dump', fullmerge)
def _idump(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
@@ -359,7 +360,7 @@ def _idump(repo, mynode, orig, fcd, fco,
util.copyfile(a, a + ".local")
repo.wwrite(fd + ".other", fco.data(), fco.flags())
repo.wwrite(fd + ".base", fca.data(), fca.flags())
- return False, 1
+ return False, 1, None
def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
tool, toolpath, binary, symlink = toolconf
@@ -386,7 +387,7 @@ def _xmerge(repo, mynode, orig, fcd, fco
repo.ui.debug('launching merge tool: %s\n' % cmd)
r = ui.system(cmd, cwd=repo.root, environ=env)
repo.ui.debug('merge tool returned: %s\n' % r)
- return True, r
+ return True, r, None
def _formatconflictmarker(repo, ctx, template, label, pad):
"""Applies the given template to the ctx, prefixed by the label.
@@ -529,8 +530,9 @@ def _filemerge(premerge, repo, mynode, o
# complete if premerge successful (r is 0)
return not r, r
- needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf, files,
- labels=labels)
+ needcheck, r, action = func(repo, mynode, orig, fcd, fco, fca, toolconf,
+ files, labels=labels)
+
if needcheck:
r = _check(r, ui, tool, fcd, files)
More information about the Mercurial-devel
mailing list