Patchwork [2,of,3] merge: only show "cannot merge flags for %s" warning if flags are different

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 12, 2016, 10:25 a.m.
Message ID <29bd20c4999865fc19ca.1476267922@localhost.localdomain>
Download mbox | patch
Permalink /patch/17042/
State Accepted
Headers show

Comments

Mads Kiilerich - Oct. 12, 2016, 10:25 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1476267738 -7200
#      Wed Oct 12 12:22:18 2016 +0200
# Node ID 29bd20c4999865fc19ca3f0344c2c1231a318b1c
# Parent  bc7af83150d0137d35d2cd9bf715fc0e3658cf8a
merge: only show "cannot merge flags for %s" warning if flags are different

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -475,7 +475,7 @@  class mergestate(object):
         flo = fco.flags()
         fla = fca.flags()
         if 'x' in flags + flo + fla and 'l' not in flags + flo + fla:
-            if fca.node() == nullid:
+            if fca.node() == nullid and flags != flo:
                 if preresolve:
                     self._repo.ui.warn(
                         _('warning: cannot merge flags for %s\n') % afile)
diff --git a/tests/test-merge-types.t b/tests/test-merge-types.t
--- a/tests/test-merge-types.t
+++ b/tests/test-merge-types.t
@@ -337,7 +337,6 @@  h: l vs l, different
   merging a
   warning: cannot merge flags for b
   merging b
-  warning: cannot merge flags for bx
   merging bx
   warning: cannot merge flags for c
   merging d
@@ -400,7 +399,6 @@  h: l vs l, different
   merging a
   warning: cannot merge flags for b
   merging b
-  warning: cannot merge flags for bx
   merging bx
   warning: cannot merge flags for c
   merging d