# HG changeset patch # User Augie Fackler # Date 1225984033 21600 # Node ID 41dc00c7aef1a1c7a9c1a772da023aa841e4179b # Parent 430af23bef4a0f7f321a2514fd3f4b47a096403e Fixed a problem where if you edited an existing symlink by replacing with another symlink, things would get corrupt. diff --git a/push_cmd.py b/push_cmd.py --- a/push_cmd.py +++ b/push_cmd.py @@ -112,11 +112,9 @@ def commit_from_rev(ui, repo, rev_ctx, h del props[file]['svn:executable'] else: props.setdefault(file, {})['svn:executable'] = None - if 'l' in parent.filectx(file).flags(): - if props.setdefault(file, {})['svn:special']: - del props[file]['svn:special'] - else: - props.setdefault(file, {})['svn:special'] = None + if ('l' in parent.filectx(file).flags() + and 'l' not in rev_ctx.filectx(file).flags()): + props.setdefault(file, {})['svn:special'] = None action = 'modify' else: base_data = parent.filectx(file).data() diff --git a/tests/test_push_command.py b/tests/test_push_command.py --- a/tests/test_push_command.py +++ b/tests/test_push_command.py @@ -328,6 +328,11 @@ class PushTests(unittest.TestCase): self.assertNotEqual(tip.node(), new_hash) self.assertEqual(tip['newdir/gamma'].data(), 'foo') + def test_push_existing_file_newly_symlink(self): + self.test_push_existing_file_newly_execute(execute=False, + link=True, + expected_flags='l') + def test_push_existing_file_newly_execute(self, execute=True, link=False, expected_flags='x'): self.test_push_to_default()