diff mercurial/merge.py @ 16001:fcf66193b186 stable

merge: defer symlink flag merging to filemerge (issue3200) Previously, we could change a normal file into a corrupt symlink when trying to merge a symlink flag. Now, we leave the flag alone and let filemerge deal with it (usually by a prompt). We also drop a redundant flag setting after filemerge (now dealt with by ms.resolve) that would cause similar corruption.
author Matt Mackall <mpm@selenic.com>
date Thu, 26 Jan 2012 20:34:57 -0600
parents 44fa047cef57
children 914bc95e227b ca5cc2976574
line wrap: on
line diff
--- a/mercurial/merge.py	Thu Jan 26 17:54:52 2012 -0600
+++ b/mercurial/merge.py	Thu Jan 26 20:34:57 2012 -0600
@@ -173,6 +173,10 @@
         if m and m != a: # changed from a to m
             return m
         if n and n != a: # changed from a to n
+            if n == 'l' or a == 'l':
+                # can't automatically merge symlink flag change here, let
+                # filemerge take care of it
+                return m
             return n
         return '' # flag was cleared
 
@@ -359,7 +363,6 @@
                     updated += 1
                 else:
                     merged += 1
-            util.setflags(repo.wjoin(fd), 'l' in flags, 'x' in flags)
             if (move and repo.dirstate.normalize(fd) != f
                 and os.path.lexists(repo.wjoin(f))):
                 repo.ui.debug("removing %s\n" % f)