/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 breezy/tests/per_pack_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2019-02-03 23:43:20 UTC
  • mfrom: (7267 work)
  • mto: This revision was merged to the branch mainline in revision 7268.
  • Revision ID: jelmer@jelmer.uk-20190203234320-zbquyl9973hbujnb
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from .. import (
27
27
    controldir,
28
28
    errors,
 
29
    gpg,
29
30
    osutils,
30
31
    repository,
31
32
    revision as _mod_revision,
299
300
                combined_indices.difference([combined_index]),
300
301
                combined_index._sibling_indices)
301
302
 
 
303
    def test_pack_with_signatures(self):
 
304
        format = self.get_format()
 
305
        tree = self.make_branch_and_tree('.', format=format)
 
306
        trans = tree.branch.repository.controldir.get_repository_transport(
 
307
            None)
 
308
        revid1 = tree.commit('start')
 
309
        revid2 = tree.commit('more work')
 
310
        strategy = gpg.LoopbackGPGStrategy(None)
 
311
        repo = tree.branch.repository
 
312
        self.addCleanup(repo.lock_write().unlock)
 
313
        repo.start_write_group()
 
314
        repo.sign_revision(revid1, strategy)
 
315
        repo.commit_write_group()
 
316
        repo.start_write_group()
 
317
        repo.sign_revision(revid2, strategy)
 
318
        repo.commit_write_group()
 
319
        tree.branch.repository.pack()
 
320
        # there should be 1 pack:
 
321
        index = self.index_class(trans, 'pack-names', None)
 
322
        self.assertEqual(1, len(list(index.iter_all_entries())))
 
323
        self.assertEqual(2, len(tree.branch.repository.all_revision_ids()))
 
324
 
302
325
    def test_pack_after_two_commits_packs_everything(self):
303
326
        format = self.get_format()
304
327
        tree = self.make_branch_and_tree('.', format=format)