/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-03-04 00:16:27 UTC
  • mfrom: (7293 work)
  • mto: This revision was merged to the branch mainline in revision 7318.
  • Revision ID: jelmer@jelmer.uk-20190304001627-v6u7o6pf97tukhek
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
        result = repo_b.search_missing_revision_ids(repo_a)
94
94
        self.assertEqual({self.rev2}, result.get_keys())
95
95
        self.assertEqual(('search', {self.rev2}, {self.rev1}, 1),
96
 
            result.get_recipe())
 
96
                         result.get_recipe())
97
97
 
98
98
    def test_absent_requested_raises(self):
99
99
        # Asking for missing revisions with a tip that is itself absent in the
105
105
        self.assertFalse(repo_b.has_revision(b'pizza'))
106
106
        # Asking specifically for an absent revision errors.
107
107
        self.assertRaises(errors.NoSuchRevision,
108
 
            repo_b.search_missing_revision_ids, repo_a, revision_ids=[b'pizza'],
109
 
            find_ghosts=True)
 
108
                          repo_b.search_missing_revision_ids, repo_a, revision_ids=[
 
109
                              b'pizza'],
 
110
                          find_ghosts=True)
110
111
        self.assertRaises(errors.NoSuchRevision,
111
 
            repo_b.search_missing_revision_ids, repo_a, revision_ids=[b'pizza'],
112
 
            find_ghosts=False)
 
112
                          repo_b.search_missing_revision_ids, repo_a, revision_ids=[
 
113
                              b'pizza'],
 
114
                          find_ghosts=False)
113
115
 
114
116
    def test_search_missing_rev_limited(self):
115
117
        # revision ids in repository A that are not referenced by the
121
123
            repo_a, revision_ids=[self.rev1])
122
124
        self.assertEqual({self.rev1}, result.get_keys())
123
125
        self.assertEqual(('search', {self.rev1}, {NULL_REVISION}, 1),
124
 
            result.get_recipe())
 
126
                         result.get_recipe())
125
127
 
126
128
    def test_search_missing_revision_ids_limit(self):
127
129
        # The limit= argument makes fetch() limit
133
135
        try:
134
136
            result = repo_b.search_missing_revision_ids(repo_a, limit=1)
135
137
        except errors.FetchLimitUnsupported:
136
 
            raise TestNotApplicable('interrepo does not support limited fetches')
 
138
            raise TestNotApplicable(
 
139
                'interrepo does not support limited fetches')
137
140
        self.assertEqual(('search', {self.rev1}, {b'null:'}, 1),
138
 
            result.get_recipe())
 
141
                         result.get_recipe())
139
142
 
140
143
    def test_fetch_fetches_signatures_too(self):
141
144
        if not self.repository_format.supports_revision_signatures:
149
152
        tree_a.branch.repository.lock_write()
150
153
        tree_a.branch.repository.start_write_group()
151
154
        tree_a.branch.repository.sign_revision(self.rev2,
152
 
            breezy.gpg.LoopbackGPGStrategy(None))
 
155
                                               breezy.gpg.LoopbackGPGStrategy(None))
153
156
        tree_a.branch.repository.commit_write_group()
154
157
        tree_a.branch.repository.unlock()
155
158
 
174
177
        # 'references' is present in both repositories, and 'tip' is present
175
178
        # just in has_ghost.
176
179
        # has_ghost       missing_ghost
177
 
        #------------------------------
 
180
        # ------------------------------
178
181
        # 'ghost'             -
179
182
        # 'references'    'references'
180
183
        # 'tip'               -
182
185
        has_ghost = self.make_repository('has_ghost')
183
186
        missing_ghost = self.make_repository('missing_ghost')
184
187
        if [True, True] != [repo._format.supports_ghosts for repo in
185
 
            (has_ghost, missing_ghost)]:
 
188
                            (has_ghost, missing_ghost)]:
186
189
            raise TestNotApplicable("Need ghost support.")
187
190
 
188
191
        def add_commit(repo, revision_id, parent_ids):
215
218
        inv = missing_ghost.get_inventory(b'ghost')
216
219
        # rev must not be corrupt now
217
220
        self.assertThat([b'ghost', b'references', b'tip'],
218
 
            MatchesAncestry(missing_ghost, b'tip'))
 
221
                        MatchesAncestry(missing_ghost, b'tip'))