~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
        self.assertRevisionNotInRepository('newbranch', trunk_revid)
151
151
        tree = new_dir.open_branch().create_checkout('local')
152
152
        new_branch_revid = tree.commit('something local')
153
 
        self.assertRevisionNotInRepository('mainline', new_branch_revid)
 
153
        self.assertRevisionNotInRepository(
 
154
            trunk_tree.branch.base, new_branch_revid)
154
155
        self.assertRevisionInRepository('newbranch', new_branch_revid)
155
156
 
156
157
    def test_sprout_stacked_from_smart_server(self):
171
172
        self.assertRevisionNotInRepository('newbranch', trunk_revid)
172
173
        tree = new_dir.open_branch().create_checkout('local')
173
174
        new_branch_revid = tree.commit('something local')
174
 
        self.assertRevisionNotInRepository('mainline', new_branch_revid)
 
175
        self.assertRevisionNotInRepository(trunk_tree.branch.user_url,
 
176
            new_branch_revid)
175
177
        self.assertRevisionInRepository('newbranch', new_branch_revid)
176
178
 
177
179
    def test_unstack_fetches(self):
482
484
        rtree = target.repository.revision_tree('rev2')
483
485
        rtree.lock_read()
484
486
        self.addCleanup(rtree.unlock)
485
 
        self.assertEqual('new content', rtree.get_file_by_path('a').read())
 
487
        self.assertEqual(
 
488
            'new content',
 
489
            rtree.get_file_text(rtree.path2id('a'), 'a'))
486
490
        self.check_lines_added_or_present(target, 'rev2')
487
491
 
488
492
    def test_transform_fallback_location_hook(self):
511
515
            repo = self.make_repository('repo', shared=True)
512
516
        except errors.IncompatibleFormat:
513
517
            raise TestNotApplicable()
 
518
        if not repo._format.supports_nesting_repositories:
 
519
            raise TestNotApplicable()
514
520
        # Avoid make_branch, which produces standalone branches.
515
521
        bzrdir = self.make_bzrdir('repo/stack-on')
516
522
        try:
546
552
        self.assertEqual({}, repo.get_parent_map(['rev1']))
547
553
        # revision_history should work, even though the history is spread over
548
554
        # multiple repositories.
549
 
        self.assertLength(2, stacked.branch.revision_history())
 
555
        self.assertEquals((2, 'rev2'), stacked.branch.last_revision_info())
550
556
 
551
557
 
552
558
class TestStackingConnections(
568
574
        stacked.set_last_revision_info(1, 'rev-base')
569
575
        stacked_relative = self.make_branch('stacked_relative',
570
576
                                            format=self.bzrdir_format)
571
 
        stacked_relative.set_stacked_on_url('../base')
 
577
        stacked_relative.set_stacked_on_url(base_tree.branch.user_url)
572
578
        stacked.set_last_revision_info(1, 'rev-base')
573
579
        self.start_logging_connections()
574
580