~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-06-11 09:11:21 UTC
  • mfrom: (4419.1.6 bug-380314)
  • Revision ID: pqm@pqm.ubuntu.com-20090611091121-s2u2yy5qa9yh4bm1
(andrew) Fix branch.revision_history() (and 'bzr pull -r 123') from
        stacked branch via HPSS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
421
421
        # Ensure that opening the branch doesn't raise.
422
422
        branch.Branch.open(transport.base)
423
423
 
 
424
    def test_revision_history_of_stacked(self):
 
425
        # See <https://launchpad.net/bugs/380314>.
 
426
        stack_on = self.make_branch_and_tree('stack-on')
 
427
        stack_on.commit('first commit', rev_id='rev1')
 
428
        try:
 
429
            stacked_dir = stack_on.bzrdir.sprout(
 
430
                self.get_url('stacked'), stacked=True)
 
431
        except unstackable_format_errors, e:
 
432
            raise TestNotApplicable('Format does not support stacking.')
 
433
        try:
 
434
            stacked = stacked_dir.open_workingtree()
 
435
        except errors.NoWorkingTree:
 
436
            stacked = stacked_dir.open_branch().create_checkout(
 
437
                'stacked-checkout', lightweight=True)
 
438
        stacked.commit('second commit', rev_id='rev2')
 
439
        # Sanity check: stacked's repo should not contain rev1, otherwise this
 
440
        # test isn't testing what it's supposed to.
 
441
        repo = stacked.branch.repository.bzrdir.open_repository()
 
442
        repo.lock_read()
 
443
        self.addCleanup(repo.unlock)
 
444
        self.assertEqual({}, repo.get_parent_map(['rev1']))
 
445
        # revision_history should work, even though the history is spread over
 
446
        # multiple repositories.
 
447
        self.assertLength(2, stacked.branch.revision_history())
 
448
 
424
449
 
425
450
class TestStackingConnections(
426
451
    transport_util.TestCaseWithConnectionHookedTransport):