Mercurial > hgsubversion
changeset 60:41dc00c7aef1
Fixed a problem where if you edited an existing symlink by replacing with another symlink, things would get corrupt.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Thu, 06 Nov 2008 09:07:13 -0600 |
parents | 430af23bef4a |
children | 243c88c47d89 |
files | push_cmd.py tests/test_push_command.py |
diffstat | 2 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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()
--- 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()