Patchwork [7,of,7,mergedriver] filemerge: don't try using external tools on change/delete conflicts

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 19, 2015, 9:33 p.m.
Message ID <4b90631e13b8d474a808.1447968839@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11539/
State Accepted
Delegated to: Martin von Zweigbergk
Headers show

Comments

Siddharth Agarwal - Nov. 19, 2015, 9:33 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1447487863 28800
#      Fri Nov 13 23:57:43 2015 -0800
# Node ID 4b90631e13b8d474a808f68733047a8c48c7b80c
# Parent  2bdd5467ac12506533d343f811efef690b88261c
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r 4b90631e13b8
filemerge: don't try using external tools on change/delete conflicts

This is mostly for completeness' sake -- the current code shouldn't get to this
point.
Martin von Zweigbergk - Nov. 20, 2015, 4:12 a.m.
Pushed to the clowncopter, thanks!

On Thu, Nov 19, 2015 at 1:39 PM Siddharth Agarwal <sid0@fb.com> wrote:

> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1447487863 28800
> #      Fri Nov 13 23:57:43 2015 -0800
> # Node ID 4b90631e13b8d474a808f68733047a8c48c7b80c
> # Parent  2bdd5467ac12506533d343f811efef690b88261c
> # Available At http://42.netv6.net/sid0-wip/hg/
> #              hg pull http://42.netv6.net/sid0-wip/hg/ -r 4b90631e13b8
> filemerge: don't try using external tools on change/delete conflicts
>
> This is mostly for completeness' sake -- the current code shouldn't get to
> this
> point.
>
> diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
> --- a/mercurial/filemerge.py
> +++ b/mercurial/filemerge.py
> @@ -447,6 +447,10 @@ def _idump(repo, mynode, orig, fcd, fco,
>
>  def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files,
> labels=None):
>      tool, toolpath, binary, symlink = toolconf
> +    if fcd.isabsent() or fco.isabsent():
> +        repo.ui.warn(_('warning: %s cannot merge change/delete conflict '
> +                       'for %s\n') % (tool, fcd.path()))
> +        return False, 1, None
>      a, b, c, back = files
>      out = ""
>      env = {'HG_FILE': fcd.path(),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -447,6 +447,10 @@  def _idump(repo, mynode, orig, fcd, fco,
 
 def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None):
     tool, toolpath, binary, symlink = toolconf
+    if fcd.isabsent() or fco.isabsent():
+        repo.ui.warn(_('warning: %s cannot merge change/delete conflict '
+                       'for %s\n') % (tool, fcd.path()))
+        return False, 1, None
     a, b, c, back = files
     out = ""
     env = {'HG_FILE': fcd.path(),