~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Packman
  • Date: 2012-01-05 09:50:04 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6426.
  • Revision ID: martin.packman@canonical.com-20120105095004-mia9xb7y0efmto0v
Merge bzr.dev to resolve conflicts in bzrlib.builtins

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        revid = tree.commit('a second commit')
97
97
        source = tree.branch
98
98
        target_transport = self.get_transport('target')
99
 
        result = tree.branch.create_clone_on_transport(target_transport,
100
 
            stacked_on=trunk.base)
 
99
        try:
 
100
            result = tree.branch.create_clone_on_transport(target_transport,
 
101
                stacked_on=trunk.base)
 
102
        except errors.UnstackableBranchFormat:
 
103
            if not trunk.repository._format.supports_full_versioned_files:
 
104
                raise tests.TestNotApplicable("can not stack on format")
 
105
            raise
101
106
        self.assertEqual(revid, result.last_revision())
102
107
        self.assertEqual(trunk.base, result.get_stacked_on_url())
103
108
 
133
138
        self.hook_calls = []
134
139
        branch.Branch.hooks.install_named_hook(
135
140
            'pre_change_branch_tip', self.assertBranchHookBranchIsStacked, None)
136
 
        result = tree.branch.create_clone_on_transport(target_transport,
137
 
            stacked_on=trunk.base)
 
141
        try:
 
142
            result = tree.branch.create_clone_on_transport(target_transport,
 
143
                stacked_on=trunk.base)
 
144
        except errors.UnstackableBranchFormat:
 
145
            if not trunk.repository._format.supports_full_versioned_files:
 
146
                raise tests.TestNotApplicable("can not stack on format")
 
147
            raise
138
148
        self.assertEqual(revid, result.last_revision())
139
149
        self.assertEqual(trunk.base, result.get_stacked_on_url())
140
150
        # Smart servers invoke hooks on both sides