~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/whitebox.py

[merge] refactoring of branch vs working tree, etc (robertc)

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
class TestBranch(TestCaseInTempDir):
10
10
 
11
 
    def test_unknowns(self):
12
 
        b = Branch.initialize('.')
13
 
 
14
 
        self.build_tree(['hello.txt',
15
 
                         'hello.txt~'])
16
 
 
17
 
        self.assertEquals(list(b.unknowns()),
18
 
                          ['hello.txt'])
19
 
 
20
11
    def test_no_changes(self):
21
12
        from bzrlib.errors import PointlessCommit
22
13
        
32
23
        b.working_tree().commit('commit pointless tree',
33
24
                 allow_pointless=True)
34
25
 
35
 
        b.add('hello.txt')
 
26
        b.working_tree().add('hello.txt')
36
27
        
37
28
        b.working_tree().commit('commit first added file',
38
29
                 allow_pointless=False)
52
43
        """Test renaming directories and the files within them."""
53
44
        b = Branch.initialize('.')
54
45
        self.build_tree(['dir/', 'dir/sub/', 'dir/sub/file'])
55
 
        b.add(['dir', 'dir/sub', 'dir/sub/file'])
 
46
        b.working_tree().add(['dir', 'dir/sub', 'dir/sub/file'])
56
47
 
57
48
        b.working_tree().commit('create initial state')
58
49
 
68
59
        self.check_inventory_shape(inv,
69
60
                                   ['dir', 'dir/sub', 'dir/sub/file'])
70
61
 
71
 
        b.rename_one('dir', 'newdir')
 
62
        b.working_tree().rename_one('dir', 'newdir')
72
63
 
73
64
        self.check_inventory_shape(b.working_tree().read_working_inventory(),
74
65
                                   ['newdir', 'newdir/sub', 'newdir/sub/file'])
75
66
 
76
 
        b.rename_one('newdir/sub', 'newdir/newsub')
 
67
        b.working_tree().rename_one('newdir/sub', 'newdir/newsub')
77
68
        self.check_inventory_shape(b.working_tree().read_working_inventory(),
78
69
                                   ['newdir', 'newdir/newsub',
79
70
                                    'newdir/newsub/file'])