~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_unversion.py

  • Committer: Martin Pool
  • Date: 2009-07-24 03:15:56 UTC
  • mfrom: (4565 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4566.
  • Revision ID: mbp@sourcefrog.net-20090724031556-5zyef6f1ixtn6r3z
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    errors,
21
21
    osutils,
22
22
    )
23
 
from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
 
23
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
24
24
 
25
25
 
26
26
class TestUnversion(TestCaseWithWorkingTree):
37
37
        tree = self.make_branch_and_tree('.')
38
38
        self.assertRaises(errors.NoSuchId, tree.unversion, ['missing-id'])
39
39
 
 
40
    def test_unversion_parent_and_child_renamed_bug_187207(self):
 
41
        # When unversioning dirstate trees show a bug in dealing with
 
42
        # unversioning children of reparented children of unversioned
 
43
        # paths when relocation entries are present and the relocation
 
44
        # points later into the dirstate.
 
45
        tree = self.make_branch_and_tree(['.'])
 
46
        self.build_tree(['del/', 'del/sub/', 'del/sub/b'])
 
47
        tree.add(['del', 'del/sub', 'del/sub/b'], ['del', 'sub', 'b'])
 
48
        tree.commit('setup')
 
49
        tree.rename_one('del/sub', 'sub')
 
50
        self.assertEqual('sub/b', tree.id2path('b'))
 
51
        tree.unversion(['del', 'b'])
 
52
        self.assertRaises(errors.NoSuchId, tree.id2path, 'b')
 
53
 
40
54
    def test_unversion_several_files(self):
41
55
        """After unversioning several files, they should not be versioned."""
42
56
        tree = self.make_branch_and_tree('.')