/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_interrepository/test_interrepository.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import breezy.errors as errors
23
23
import breezy.gpg
24
24
from breezy.bzr.inventory import Inventory
 
25
from breezy.repository import WriteGroup
25
26
from breezy.revision import NULL_REVISION
26
27
from breezy.tests import (
27
28
    TestNotApplicable,
65
66
        tree_a = self.make_branch_and_tree('a')
66
67
        self.controldir = tree_a.branch.controldir
67
68
        # add a corrupt inventory 'orphan'
68
 
        tree_a.branch.repository.lock_write()
69
 
        tree_a.branch.repository.start_write_group()
70
 
        if tree_a.branch.repository._format.supports_ghosts:
71
 
            inv_file = tree_a.branch.repository.inventories
72
 
            inv_file.add_lines((b'orphan',), [], [])
73
 
        tree_a.branch.repository.commit_write_group()
74
 
        tree_a.branch.repository.unlock()
 
69
        with tree_a.branch.repository.lock_write(), WriteGroup(tree_a.branch.repository):
 
70
            if tree_a.branch.repository._format.supports_ghosts:
 
71
                inv_file = tree_a.branch.repository.inventories
 
72
                inv_file.add_lines((b'orphan',), [], [])
75
73
        # add a real revision 'rev1'
76
74
        self.rev1 = tree_a.commit('rev1', allow_pointless=True)
77
75
        # add a real revision 'rev2' based on rev1
149
147
                'to repository does not support signatures')
150
148
        # and sign 'rev2'
151
149
        tree_a = WorkingTree.open('a')
152
 
        tree_a.branch.repository.lock_write()
153
 
        tree_a.branch.repository.start_write_group()
154
 
        tree_a.branch.repository.sign_revision(self.rev2,
155
 
                                               breezy.gpg.LoopbackGPGStrategy(None))
156
 
        tree_a.branch.repository.commit_write_group()
157
 
        tree_a.branch.repository.unlock()
 
150
        with tree_a.branch.repository.lock_write(), \
 
151
                WriteGroup(tree_a.branch.repository):
 
152
            tree_a.branch.repository.sign_revision(
 
153
                self.rev2, breezy.gpg.LoopbackGPGStrategy(None))
158
154
 
159
155
        from_repo = self.controldir.open_repository()
160
156
        from_signature = from_repo.get_signature_text(self.rev2)