/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/test_smart_add.py

merge robert, debugging

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
        wt = self.make_branch_and_tree('.')
115
115
        self.build_tree(['file'])
116
116
        smart_add_tree(wt, ['file'], save=False)
117
 
        self.assertNotEqual(wt.path2id('file'), None, "No id added for 'file'")
118
 
        wt.read_working_inventory()
119
117
        self.assertEqual(wt.path2id('file'), None)
120
118
 
121
119
    def test_add_dry_run(self):
258
256
                              'added dir1/file2 with id file-dir1%file2\n',
259
257
                              'added file1 with id file-file1\n',
260
258
                             ], lines)
261
 
        self.assertEqual([('', wt.inventory.root.file_id),
 
259
        wt.lock_read()
 
260
        self.addCleanup(wt.unlock)
 
261
        self.assertEqual([('', wt.path2id('')),
262
262
                          ('dir1', 'directory-dir1'),
263
263
                          ('dir1/file2', 'file-dir1%file2'),
264
264
                          ('file1', 'file-file1'),
341
341
        # These should get newly generated ids
342
342
        c_id = new_tree.path2id('c')
343
343
        self.assertNotEqual(None, c_id)
 
344
        self.base_tree.lock_read()
 
345
        self.addCleanup(self.base_tree.unlock)
344
346
        self.failIf(c_id in self.base_tree)
345
347
 
346
348
        d_id = new_tree.path2id('subdir/d')
364
366
        # matching path or child of 'subby'.
365
367
        a_id = new_tree.path2id('subby/a')
366
368
        self.assertNotEqual(None, a_id)
 
369
        self.base_tree.lock_read()
 
370
        self.addCleanup(self.base_tree.unlock)
367
371
        self.failIf(a_id in self.base_tree)
368
372
 
369
373
 
383
387
        osutils.normalized_filename = osutils._accessible_normalized_filename
384
388
        try:
385
389
            smart_add_tree(self.wt, [u'a\u030a'])
 
390
            self.wt.lock_read()
 
391
            self.addCleanup(self.wt.unlock)
386
392
            self.assertEqual([('', 'directory'), (u'\xe5', 'file')],
387
393
                    [(path, ie.kind) for path,ie in 
388
394
                        self.wt.inventory.iter_entries()])
395
401
        osutils.normalized_filename = osutils._accessible_normalized_filename
396
402
        try:
397
403
            smart_add_tree(self.wt, [])
 
404
            self.wt.lock_read()
 
405
            self.addCleanup(self.wt.unlock)
398
406
            self.assertEqual([('', 'directory'), (u'\xe5', 'file')],
399
407
                    [(path, ie.kind) for path,ie in 
400
408
                        self.wt.inventory.iter_entries()])