~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-17 03:20:35 UTC
  • mfrom: (4792.4.3 456036)
  • Revision ID: pqm@pqm.ubuntu.com-20091117032035-s3sgtlixj1lrminn
(Gordon Tyler) Fix IndexError during 'bzr ignore /' (#456036)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
from stat import S_ISDIR
26
26
from StringIO import StringIO
27
 
import sys
28
27
 
29
28
import bzrlib
30
29
from bzrlib.errors import (NotBranchError,
253
252
        tree = control.create_workingtree()
254
253
        tree.add(['foo'], ['Foo:Bar'], ['file'])
255
254
        tree.put_file_bytes_non_atomic('Foo:Bar', 'content\n')
256
 
        try:
257
 
            tree.commit('first post', rev_id='first')
258
 
        except errors.IllegalPath:
259
 
            if sys.platform != 'win32':
260
 
                raise
261
 
            self.knownFailure('Foo:Bar cannot be used as a file-id on windows'
262
 
                              ' in repo format 7')
263
 
            return
 
255
        tree.commit('first post', rev_id='first')
264
256
        self.assertEqualDiff(
265
257
            '# bzr weave file v5\n'
266
258
            'i\n'
1168
1160
        # check some arbitrary big numbers
1169
1161
        self.assertEqual(25, packs._max_pack_count(112894))
1170
1162
 
1171
 
    def test_repr(self):
1172
 
        packs = self.get_packs()
1173
 
        self.assertContainsRe(repr(packs),
1174
 
            'RepositoryPackCollection(.*Repository(.*))')
1175
 
 
1176
1163
    def test_pack_distribution_zero(self):
1177
1164
        packs = self.get_packs()
1178
1165
        self.assertEqual([0], packs.pack_distribution(0))
1432
1419
            index_class=BTreeGraphIndex,
1433
1420
            use_chk_index=False)
1434
1421
        pack = pack_repo.NewPack(collection)
1435
 
        self.addCleanup(pack.abort) # Make sure the write stream gets closed
1436
1422
        self.assertIsInstance(pack.revision_index, BTreeBuilder)
1437
1423
        self.assertIsInstance(pack.inventory_index, BTreeBuilder)
1438
1424
        self.assertIsInstance(pack._hash, type(osutils.md5()))
1491
1477
        packer = pack_repo.OptimisingPacker(self.get_pack_collection(),
1492
1478
                                            [], '.test')
1493
1479
        new_pack = packer.open_pack()
1494
 
        self.addCleanup(new_pack.abort) # ensure cleanup
1495
1480
        self.assertIsInstance(new_pack, pack_repo.NewPack)
1496
1481
        self.assertTrue(new_pack.revision_index._optimize_for_size)
1497
1482
        self.assertTrue(new_pack.inventory_index._optimize_for_size)