421
421
# Ensure that opening the branch doesn't raise.
422
422
branch.Branch.open(transport.base)
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')
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.')
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()
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())
425
450
class TestStackingConnections(
426
451
transport_util.TestCaseWithConnectionHookedTransport):