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

Martin Pool mbp at sourcefrog.net
Thu May 3 14:58:37 BST 2007


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

john suggested this should be fixed for 0.16final.  I have a partial
fix which I thought I would air now.  There are still some failures in
test_post_push_bound_branch, for reasons I don't understand yet.

This does basically:

1- Renames the private parameter _run_hooks to _primary_branch to
better reflect its purpose as explained by Robert.  That is, when we
pull into a bound branch there are really two pulls: into the master
and into the bound branch.  We only want to run the pull hook once,
for the transfer into the bound branch.

(I'm not quite sure of that, maybe we should run it twice and just let
the hook decide to do nothing if it's in a master branch.  Robert says
the only push/pull hooks he can think of are those that send
notifications, and they'll only want to run once.)

2- Make RemoteBranch.pull pass any kwargs through to the real branch,
including the _primary_branch indicator.  After writing this mail I
realize this is actually the wrong thing, because to pass the correct
values to the hooks we need to run them on the RemoteBranch, not the
real branch.  That means that we should ask the real branch to pull,
but pass the option telling it not to run hooks.  (And that option
should probably be renamed back, so there you go...)

3- There were previously some per-branch-implementation tests for
running hooks on bound branches, but they only worked if the branch
could be bound to another of the same type
(https://bugs.launchpad.net/bzr/+bug/112020).

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.tmp
Type: application/octet-stream
Size: 7696 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070503/a29d4f7c/attachment.obj 


More information about the bazaar mailing list