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

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
                          control.transport.get,
164
164
                          'ancestry.weave')
165
165
 
 
166
    def test_exposed_versioned_files_are_marked_dirty(self):
 
167
        control = bzrdir.BzrDirFormat6().initialize(self.get_url())
 
168
        repo = weaverepo.RepositoryFormat6().initialize(control)
 
169
        repo.lock_write()
 
170
        inv = repo.get_inventory_weave()
 
171
        repo.unlock()
 
172
        self.assertRaises(errors.OutSideTransaction,
 
173
            inv.add_lines, 'foo', [], [])
 
174
 
166
175
 
167
176
class TestFormat7(TestCaseWithTransport):
168
177
    
267
276
                             'W\n',
268
277
                             t.get('inventory.weave').read())
269
278
 
 
279
    def test_exposed_versioned_files_are_marked_dirty(self):
 
280
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
 
281
        repo = weaverepo.RepositoryFormat7().initialize(control)
 
282
        repo.lock_write()
 
283
        inv = repo.get_inventory_weave()
 
284
        repo.unlock()
 
285
        self.assertRaises(errors.OutSideTransaction,
 
286
            inv.add_lines, 'foo', [], [])
 
287
 
270
288
 
271
289
class TestFormatKnit1(TestCaseWithTransport):
272
290
    
345
363
        self.assertTrue(S_ISDIR(t.stat('knits').st_mode))
346
364
        self.check_knits(t)
347
365
 
 
366
    def test_exposed_versioned_files_are_marked_dirty(self):
 
367
        format = bzrdir.BzrDirMetaFormat1()
 
368
        format.repository_format = knitrepo.RepositoryFormatKnit1()
 
369
        repo = self.make_repository('.', format=format)
 
370
        repo.lock_write()
 
371
        inv = repo.get_inventory_weave()
 
372
        repo.unlock()
 
373
        self.assertRaises(errors.OutSideTransaction,
 
374
            inv.add_lines, 'foo', [], [])
 
375
 
348
376
 
349
377
class KnitRepositoryStreamTests(test_knit.KnitTests):
350
378
    """Tests for knitrepo._get_stream_as_bytes."""
420
448
 
421
449
    This is for use during testing where we use DummyRepository as repositories
422
450
    so that none of the default regsitered inter-repository classes will
423
 
    match.
 
451
    MATCH.
424
452
    """
425
453
 
426
454
    @staticmethod
605
633
        revision_tree = tree.branch.repository.revision_tree('dull2')
606
634
        self.assertEqual('dull', revision_tree.inventory.root.revision)
607
635
 
 
636
    def test_exposed_versioned_files_are_marked_dirty(self):
 
637
        format = bzrdir.BzrDirMetaFormat1()
 
638
        format.repository_format = knitrepo.RepositoryFormatKnit3()
 
639
        repo = self.make_repository('.', format=format)
 
640
        repo.lock_write()
 
641
        inv = repo.get_inventory_weave()
 
642
        repo.unlock()
 
643
        self.assertRaises(errors.OutSideTransaction,
 
644
            inv.add_lines, 'foo', [], [])
 
645
 
608
646
 
609
647
class TestWithBrokenRepo(TestCaseWithTransport):
610
648
 
673
711
        file_id = filename + '-id'
674
712
        entry = inventory.InventoryFile(file_id, filename, 'TREE_ROOT')
675
713
        entry.revision = revision
 
714
        entry.text_size = 0
676
715
        inv.add(entry)
677
716
        vf = repo.weave_store.get_weave_or_empty(file_id,
678
717
                                                 repo.get_transaction())