151
152
raise KnownFailure('there is no support for'
152
153
' symlinks to non-ASCII targets (bug #272444)')
155
def assertBranchHookBranchIsStacked(self, pre_change_params):
156
# Just calling will either succeed or fail.
157
pre_change_params.branch.get_stacked_on_url()
158
self.hook_calls.append(pre_change_params)
160
def test_sprout_stacked_hooks_get_stacked_branch(self):
161
tree = self.make_branch_and_tree('source')
162
tree.commit('a commit')
163
revid = tree.commit('a second commit')
165
target_transport = self.get_transport('target')
167
_mod_branch.Branch.hooks.install_named_hook("pre_change_branch_tip",
168
self.assertBranchHookBranchIsStacked, None)
170
dir = source.bzrdir.sprout(target_transport.base,
171
source.last_revision(), possible_transports=[target_transport],
172
source_branch=source, stacked=True)
173
except errors.UnstackableBranchFormat:
174
if isinstance(self.branch_format, _mod_branch.BzrBranchFormat4):
175
raise KnownFailure("Format 4 doesn't auto stack successfully.")
178
result = dir.open_branch()
179
self.assertEqual(revid, result.last_revision())
180
self.assertEqual(source.base, result.get_stacked_on_url())
181
# Smart servers invoke hooks on both sides
182
if isinstance(result, remote.RemoteBranch):
186
self.assertEqual(expected_calls, len(self.hook_calls))