merge: defer symlink flag merging to filemerge (issue3200) stable
authorMatt Mackall <mpm@selenic.com>
Thu, 26 Jan 2012 20:34:57 -0600
branchstable
changeset 16001 fcf66193b186
parent 16000 25fa240139cb
child 16004 7d12b2d3a83d
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.
mercurial/merge.py
--- 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)