# HG changeset patch # User Augie Fackler # Date 1225985073 21600 # Node ID cc5ebdb1e8d4c594d40c59aca605d1717682d9c2 # Parent 243c88c47d89d98f5a6e8adcd3099c355d52cad4 push_cmd: Further simplified some logic thanks to an improved test. diff --git a/push_cmd.py b/push_cmd.py --- a/push_cmd.py +++ b/push_cmd.py @@ -107,11 +107,9 @@ def commit_from_rev(ui, repo, rev_ctx, h added_dirs.append(dirname[:-1]) else: base_data = parent.filectx(file).data() - if 'x' in parent.filectx(file).flags(): - if 'svn:executable' in props.setdefault(file, {}): - del props[file]['svn:executable'] - else: - props.setdefault(file, {})['svn:executable'] = None + if ('x' in parent.filectx(file).flags() + and 'x' not in rev_ctx.filectx(file).flags()): + props.setdefault(file, {})['svn:executable'] = None if ('l' in parent.filectx(file).flags() and 'l' not in rev_ctx.filectx(file).flags()): props.setdefault(file, {})['svn:special'] = None 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 @@ -388,6 +388,32 @@ class PushTests(unittest.TestCase): self.assertEqual(tip['alpha'].data(), 'bar') self.assertEqual(tip.parents()[0]['alpha'].flags(), expected_flags) self.assertEqual(tip['alpha'].flags(), expected_flags) + # now test removing the property entirely + repo = self.repo + def file_callback(repo, memctx, path): + return context.memfilectx(path=path, + data='bar', + islink=False, + isexec=False, + copied=False) + ctx = context.memctx(repo, + (repo['default'].node(), node.nullid), + 'message', + ['alpha', ], + file_callback, + 'author', + '2008-01-01 00:00:00 -0500', + {'branch': 'default', }) + new_hash = repo.commitctx(ctx) + hg.update(repo, repo['tip'].node()) + push_cmd.push_revisions_to_subversion(ui.ui(), repo=self.repo, + hg_repo_path=self.wc_path, + svn_url='file://' + self.repo_path) + tip = self.repo['tip'] + self.assertNotEqual(tip.node(), new_hash) + self.assertEqual(tip['alpha'].data(), 'bar') + self.assertEqual(tip.parents()[0]['alpha'].flags(), expected_flags) + self.assertEqual(tip['alpha'].flags(), '') def suite():