~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_interrepository/test_fetch.py

MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
            to_repo.texts.get_record_stream([('foo', revid)],
135
135
            'unordered', True).next().get_bytes_as('fulltext'))
136
136
 
 
137
    def test_fetch_from_stacked_smart(self):
 
138
        self.setup_smart_server_with_call_log()
 
139
        self.test_fetch_from_stacked()
 
140
 
 
141
    def test_fetch_from_stacked_smart_old(self):
 
142
        self.setup_smart_server_with_call_log()
 
143
        self.disable_verb('Repository.get_stream_1.19')
 
144
        self.test_fetch_from_stacked()
 
145
 
 
146
    def test_fetch_from_stacked(self):
 
147
        """Fetch from a stacked branch succeeds."""
 
148
        if not self.repository_format.supports_external_lookups:
 
149
            raise TestNotApplicable("Need stacking support in the source.")
 
150
        builder = self.make_branch_builder('full-branch')
 
151
        builder.start_series()
 
152
        builder.build_snapshot('first', None, [
 
153
            ('add', ('', 'root-id', 'directory', '')),
 
154
            ('add', ('file', 'file-id', 'file', 'content\n'))])
 
155
        builder.build_snapshot('second', ['first'], [
 
156
            ('modify', ('file-id', 'second content\n'))])
 
157
        builder.build_snapshot('third', ['second'], [
 
158
            ('modify', ('file-id', 'third content\n'))])
 
159
        builder.finish_series()
 
160
        branch = builder.get_branch()
 
161
        repo = self.make_repository('stacking-base')
 
162
        trunk = repo.bzrdir.create_branch()
 
163
        trunk.repository.fetch(branch.repository, 'second')
 
164
        repo = self.make_repository('stacked')
 
165
        stacked_branch = repo.bzrdir.create_branch()
 
166
        stacked_branch.set_stacked_on_url(trunk.base)
 
167
        stacked_branch.repository.fetch(branch.repository, 'third')
 
168
        target = self.make_to_repository('target')
 
169
        target.fetch(stacked_branch.repository, 'third')
 
170
        target.lock_read()
 
171
        self.addCleanup(target.unlock)
 
172
        all_revs = set(['first', 'second', 'third'])
 
173
        self.assertEqual(all_revs, set(target.get_parent_map(all_revs)))
 
174
 
137
175
    def test_fetch_parent_inventories_at_stacking_boundary_smart(self):
138
176
        self.setup_smart_server_with_call_log()
139
177
        self.test_fetch_parent_inventories_at_stacking_boundary()