/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_move.py

Merge in bzr.dev 3935

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    osutils,
24
24
    )
25
25
 
26
 
from bzrlib.workingtree_4 import WorkingTreeFormat4
 
26
from bzrlib.workingtree_4 import DirStateWorkingTreeFormat
27
27
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
28
28
 
29
29
 
43
43
        actual = self.get_tree_layout(tree)
44
44
        self.assertEqual(expected, actual)
45
45
 
 
46
    def test_move_via_rm_and_add(self):
 
47
        """Move by remove and add-with-id"""
 
48
        self.build_tree(['a1', 'b1'])
 
49
        tree = self.make_branch_and_tree('.')
 
50
        tree.add(['a1'], ids=['a1-id'])
 
51
        tree.commit('initial commit')
 
52
        tree.remove('a1', force=True, keep_files=False)
 
53
        tree.add(['b1'], ids=['a1-id'])
 
54
        tree._validate()
 
55
 
46
56
    def test_move_correct_call_named(self):
47
57
        """tree.move has the deprecated parameter 'to_name'.
48
58
        It has been replaced by 'to_dir' for consistency.
99
109
                                tree.move, ['a1'], to_name='sub1',
100
110
                                after=False)
101
111
        except TypeError:
102
 
            # WorkingTreeFormat4 doesn't have to maintain api compatibility
103
 
            # since it was deprecated before the class was introduced.
104
 
            if not isinstance(self.workingtree_format, WorkingTreeFormat4):
 
112
            # WorkingTreeFormat4 and later don't have to maintain api
 
113
            # compatibility since it was deprecated before they were introduced.
 
114
            if not isinstance(self.workingtree_format,
 
115
                DirStateWorkingTreeFormat):
105
116
                raise
106
117
        tree._validate()
107
118