[merge][0.16][#111968] error in _run_hooks when pulling or pushing in a branch bound to a remote branch

Martin Pool mbp at sourcefrog.net
Fri May 4 11:57:11 BST 2007


This bundle fixes

> https://bugs.launchpad.net/bzr/+bug/111968

that you get an error about _run_hooks when pulling into a branch
bound to a bzr+ssh branch.

The first thing here is that we adjust the tests for push and pull
hooks so that, if the format being tested can't be a bound branch, we
make a branch of the default type and bind to an instance of the
branch under test.

There was a conceptual bug in Branch.push in that it was overridden in
the subcall that supports binding to add intelligence about binding.
The problem is that this dispatches based on the push source, but
binding actually affects the target.  So I've rearranged the push code
so that the binding intelligence is in the BzrBranch base, though of
course it's only active if the branch uses it.  I'd like to think the
result is a lot cleaner (though longer) - rather than calling back
into base classes with special parameters we instead have more of a
decomposed or template method style.

I fixed in passing a bug that hooks are given the _real_branch when
called on RemoteBranches -- there used to be a special exemption for
this in the test.

I think pull could get a similar cleanup but it's not so urgent.

I think this is pretty clear and correct but it's not trivial so I'm
going to wait for pre-review, and then hopefully do a release with
this tomorrow morning.

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20070504-push-pull-hooks.diff
Type: text/x-diff
Size: 58008 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070504/d57036cd/attachment-0001.bin 


More information about the bazaar mailing list