Rev 5351: Delete the to_name parameter from WorkingTree.move() in file:///home/vila/src/bzr/cleanup/deprecations/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Jul 15 14:33:30 BST 2010


At file:///home/vila/src/bzr/cleanup/deprecations/

------------------------------------------------------------
revno: 5351
revision-id: v.ladeuil+lp at free.fr-20100715133330-u06o1t8rkqf7rmw9
parent: v.ladeuil+lp at free.fr-20100715130540-nac9q1yu78870v0e
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: deprecations
timestamp: Thu 2010-07-15 15:33:30 +0200
message:
  Delete the to_name parameter from WorkingTree.move()
-------------- next part --------------
=== modified file 'bzrlib/tests/per_workingtree/test_move.py'
--- a/bzrlib/tests/per_workingtree/test_move.py	2009-07-10 07:14:02 +0000
+++ b/bzrlib/tests/per_workingtree/test_move.py	2010-07-15 13:33:30 +0000
@@ -79,43 +79,6 @@
             tree.move(['a1'], 'sub1', after=False))
         tree._validate()
 
-    def test_move_deprecated_wrong_call(self):
-        """tree.move has the deprecated parameter 'to_name'.
-        It has been replaced by 'to_dir' for consistency.
-        Test the new API using wrong parameter
-        """
-        self.build_tree(['a1', 'sub1/'])
-        tree = self.make_branch_and_tree('.')
-        tree.add(['a1', 'sub1'])
-        tree.commit('initial commit')
-        self.assertRaises(TypeError, tree.move, ['a1'],
-                          to_this_parameter_does_not_exist='sub1',
-                          after=False)
-        tree._validate()
-
-    def test_move_deprecated_call(self):
-        """tree.move has the deprecated parameter 'to_name'.
-        It has been replaced by 'to_dir' for consistency.
-        Test the new API using deprecated parameter
-        """
-        self.build_tree(['a1', 'sub1/'])
-        tree = self.make_branch_and_tree('.')
-        tree.add(['a1', 'sub1'])
-        tree.commit('initial commit')
-
-        try:
-            self.callDeprecated(['The parameter to_name was deprecated'
-                                 ' in version 0.13. Use to_dir instead'],
-                                tree.move, ['a1'], to_name='sub1',
-                                after=False)
-        except TypeError:
-            # WorkingTreeFormat4 and later don't have to maintain api
-            # compatibility since it was deprecated before they were introduced.
-            if not isinstance(self.workingtree_format,
-                DirStateWorkingTreeFormat):
-                raise
-        tree._validate()
-
     def test_move_target_not_dir(self):
         tree = self.make_branch_and_tree('.')
         self.build_tree(['a'])

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2010-07-06 19:48:05 +0000
+++ b/bzrlib/workingtree.py	2010-07-15 13:33:30 +0000
@@ -1264,7 +1264,7 @@
                 stack.pop()
 
     @needs_tree_write_lock
-    def move(self, from_paths, to_dir=None, after=False, **kwargs):
+    def move(self, from_paths, to_dir=None, after=False):
         """Rename files.
 
         to_dir must exist in the inventory.
@@ -1304,14 +1304,7 @@
 
         # check for deprecated use of signature
         if to_dir is None:
-            to_dir = kwargs.get('to_name', None)
-            if to_dir is None:
-                raise TypeError('You must supply a target directory')
-            else:
-                symbol_versioning.warn('The parameter to_name was deprecated'
-                                       ' in version 0.13. Use to_dir instead',
-                                       DeprecationWarning)
-
+            raise TypeError('You must supply a target directory')
         # check destination directory
         if isinstance(from_paths, basestring):
             raise ValueError()



More information about the bazaar-commits mailing list