~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Alexander Belchenko
  • Date: 2007-10-04 05:50:44 UTC
  • mfrom: (2881 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2884.
  • Revision ID: bialix@ukr.net-20071004055044-pb88kgkfayawro8n
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
                          control.transport.get,
161
161
                          'ancestry.weave')
162
162
 
 
163
    def test_exposed_versioned_files_are_marked_dirty(self):
 
164
        control = bzrdir.BzrDirFormat6().initialize(self.get_url())
 
165
        repo = weaverepo.RepositoryFormat6().initialize(control)
 
166
        repo.lock_write()
 
167
        inv = repo.get_inventory_weave()
 
168
        repo.unlock()
 
169
        self.assertRaises(errors.OutSideTransaction,
 
170
            inv.add_lines, 'foo', [], [])
 
171
 
163
172
 
164
173
class TestFormat7(TestCaseWithTransport):
165
174
    
264
273
                             'W\n',
265
274
                             t.get('inventory.weave').read())
266
275
 
 
276
    def test_exposed_versioned_files_are_marked_dirty(self):
 
277
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
 
278
        repo = weaverepo.RepositoryFormat7().initialize(control)
 
279
        repo.lock_write()
 
280
        inv = repo.get_inventory_weave()
 
281
        repo.unlock()
 
282
        self.assertRaises(errors.OutSideTransaction,
 
283
            inv.add_lines, 'foo', [], [])
 
284
 
267
285
 
268
286
class TestFormatKnit1(TestCaseWithTransport):
269
287
    
342
360
        self.assertTrue(S_ISDIR(t.stat('knits').st_mode))
343
361
        self.check_knits(t)
344
362
 
 
363
    def test_exposed_versioned_files_are_marked_dirty(self):
 
364
        format = bzrdir.BzrDirMetaFormat1()
 
365
        format.repository_format = knitrepo.RepositoryFormatKnit1()
 
366
        repo = self.make_repository('.', format=format)
 
367
        repo.lock_write()
 
368
        inv = repo.get_inventory_weave()
 
369
        repo.unlock()
 
370
        self.assertRaises(errors.OutSideTransaction,
 
371
            inv.add_lines, 'foo', [], [])
 
372
 
345
373
 
346
374
class KnitRepositoryStreamTests(test_knit.KnitTests):
347
375
    """Tests for knitrepo._get_stream_as_bytes."""
417
445
 
418
446
    This is for use during testing where we use DummyRepository as repositories
419
447
    so that none of the default regsitered inter-repository classes will
420
 
    match.
 
448
    MATCH.
421
449
    """
422
450
 
423
451
    @staticmethod
559
587
        revision_tree = tree.branch.repository.revision_tree('dull2')
560
588
        self.assertEqual('dull', revision_tree.inventory.root.revision)
561
589
 
 
590
    def test_exposed_versioned_files_are_marked_dirty(self):
 
591
        format = bzrdir.BzrDirMetaFormat1()
 
592
        format.repository_format = knitrepo.RepositoryFormatKnit3()
 
593
        repo = self.make_repository('.', format=format)
 
594
        repo.lock_write()
 
595
        inv = repo.get_inventory_weave()
 
596
        repo.unlock()
 
597
        self.assertRaises(errors.OutSideTransaction,
 
598
            inv.add_lines, 'foo', [], [])