~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_stacking.py

  • Committer: Aaron Bentley
  • Date: 2008-07-16 14:23:05 UTC
  • mto: This revision was merged to the branch mainline in revision 3544.
  • Revision ID: aaron@aaronbentley.com-20080716142305-yzq8awjy5c2l1vp6
Fix fetch from stacked respositories (#248506)

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
                errors.UnstackableRepositoryFormat):
173
173
            # not a testable combination.
174
174
            return
175
 
        try:
176
 
            cloned_unstacked_bzrdir = stacked_bzrdir.clone('cloned-unstacked',
177
 
                preserve_stacking=False)
178
 
        except errors.NoSuchRevision:
179
 
            raise KnownFailure(
180
 
                'Pack-to-pack fetch does not handle stacking properly.'
181
 
                ' (#248506)')
182
 
        else:
183
 
            self.fail('Expected a failure due to broken fetching.')
 
175
        cloned_unstacked_bzrdir = stacked_bzrdir.clone('cloned-unstacked',
 
176
            preserve_stacking=False)
184
177
        unstacked_branch = cloned_unstacked_bzrdir.open_branch()
185
178
        self.assertRaises((errors.NotStacked, errors.UnstackableBranchFormat),
186
179
                          unstacked_branch.get_stacked_on_url)
215
208
            self.assertEqual('../stack-on', target.get_stacked_on_url())
216
209
        except errors.UnstackableBranchFormat:
217
210
            pass
 
211
 
 
212
    def test_fetch_copies_from_stacked_on(self):
 
213
        stack_on = self.make_branch_and_tree('stack-on')
 
214
        stack_on.commit('first commit', rev_id='rev1')
 
215
        try:
 
216
            stacked_dir = stack_on.bzrdir.sprout('stacked', stacked=True)
 
217
        except (errors.UnstackableRepositoryFormat,
 
218
                errors.UnstackableBranchFormat):
 
219
            raise TestNotApplicable('Format does not support stacking.')
 
220
        unstacked = self.make_repository('unstacked')
 
221
        unstacked.fetch(stacked_dir.open_branch().repository, 'rev1')
 
222
        unstacked.get_revision('rev1')