# HG changeset patch # User Matt Mackall # Date 1327631697 21600 # Node ID fcf66193b18699141e1da1ef4de4795d62a658cb # Parent 25fa240139cb914661ca87db4a186931b291714a 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. diff -r 25fa240139cb -r fcf66193b186 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)