Patchwork [3,of,3] merge: clarify warning for (not) merging flags without ancestor

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 12, 2016, 10:25 a.m.
Message ID <9588752fc3a6d2b5b1f4.1476267923@localhost.localdomain>
Download mbox | patch
Permalink /patch/17041/
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 9588752fc3a6d2b5b1f40ddfc48965997270892d
# Parent  29bd20c4999865fc19ca3f0344c2c1231a318b1c
merge: clarify warning for (not) merging flags without ancestor

Give hints why it can't merge and what it will do instead.
Pierre-Yves David - Oct. 14, 2016, 12:17 p.m.
On 10/12/2016 12:25 PM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1476267738 -7200
> #      Wed Oct 12 12:22:18 2016 +0200
> # Node ID 9588752fc3a6d2b5b1f40ddfc48965997270892d
> # Parent  29bd20c4999865fc19ca3f0344c2c1231a318b1c
> merge: clarify warning for (not) merging flags without ancestor

Pushed, thanks

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -478,7 +478,9 @@  class mergestate(object):
             if fca.node() == nullid and flags != flo:
                 if preresolve:
                     self._repo.ui.warn(
-                        _('warning: cannot merge flags for %s\n') % afile)
+                        _('warning: cannot merge flags for %s '
+                          'without common ancestor - keeping local flags\n')
+                        % afile)
             elif flags == fla:
                 flags = flo
         if preresolve:
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
@@ -335,10 +335,10 @@  h: l vs l, different
 
   $ hg merge
   merging a
-  warning: cannot merge flags for b
+  warning: cannot merge flags for b without common ancestor - keeping local flags
   merging b
   merging bx
-  warning: cannot merge flags for c
+  warning: cannot merge flags for c without common ancestor - keeping local flags
   merging d
   warning: internal :merge cannot merge symlinks for d
   warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
@@ -397,10 +397,10 @@  h: l vs l, different
   $ hg up -Cqr1
   $ hg merge
   merging a
-  warning: cannot merge flags for b
+  warning: cannot merge flags for b without common ancestor - keeping local flags
   merging b
   merging bx
-  warning: cannot merge flags for c
+  warning: cannot merge flags for c without common ancestor - keeping local flags
   merging d
   warning: internal :merge cannot merge symlinks for d
   warning: conflicts while merging d! (edit, then use 'hg resolve --mark')