/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/blackbox/test_versioning.py

[merge] update from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
        self.assertEquals(delta.added[0][0], 'dir')
115
115
        self.failIf(delta.modified)
116
116
 
117
 
    def test_working_tree_add_in_unversioned(self):
118
 
        """Try to add a file in an unversioned directory.
119
 
 
120
 
        "bzr add" adds the parent as necessary, but simple working tree add
121
 
        doesn't do that.
122
 
        """
123
 
        from bzrlib.branch import Branch
124
 
        from bzrlib.errors import NotVersionedError
125
 
        from bzrlib.workingtree import WorkingTree
126
 
 
127
 
        b = Branch.initialize(u'.')
128
 
 
129
 
        self.build_tree(['foo/',
130
 
                         'foo/hello'])
131
 
 
132
 
        self.assertRaises(NotVersionedError,
133
 
                          WorkingTree(b.base, b).add,
134
 
                          'foo/hello')
135
 
        
136
 
        self.check_branch()
137
 
 
138
117
    def check_branch(self):
139
118
        """After all the above changes, run the check and upgrade commands.
140
119
 
171
150
        mutter('start selective subdir commit')
172
151
        run_bzr('commit', 'a', '-m', 'commit a only')
173
152
        
174
 
        old = b.revision_tree(b.get_rev_id(1))
175
 
        new = b.revision_tree(b.get_rev_id(2))
 
153
        old = b.repository.revision_tree(b.get_rev_id(1))
 
154
        new = b.repository.revision_tree(b.get_rev_id(2))
176
155
        
177
156
        eq(new.get_file_by_path('b/two').read(), 'old contents')
178
157
        eq(new.get_file_by_path('top').read(), 'old contents')
181
160
        os.chdir('a')
182
161
        # commit from here should do nothing
183
162
        run_bzr('commit', '.', '-m', 'commit subdir only', '--unchanged')
184
 
        v3 = b.revision_tree(b.get_rev_id(3))
 
163
        v3 = b.repository.revision_tree(b.get_rev_id(3))
185
164
        eq(v3.get_file_by_path('b/two').read(), 'old contents')
186
165
        eq(v3.get_file_by_path('top').read(), 'old contents')
187
166
        eq(v3.get_file_by_path('a/one').read(), 'new contents')
188
167
                
189
168
        # commit in subdirectory commits whole tree
190
169
        run_bzr('commit', '-m', 'commit whole tree from subdir')
191
 
        v4 = b.revision_tree(b.get_rev_id(4))
 
170
        v4 = b.repository.revision_tree(b.get_rev_id(4))
192
171
        eq(v4.get_file_by_path('b/two').read(), 'new contents')        
193
172
        eq(v4.get_file_by_path('top').read(), 'new contents')
194
173