Bound branches revisited
John A Meinel
john at arbash-meinel.com
Fri Dec 30 23:06:09 GMT 2005
John Arbash Meinel wrote:
> I want to re-open the discussion about bound branches, since I would
> like to implement them soon.
>
> I know it was discussed that doing a commit to a bound branch would do
> the remote commit, and then just do a pull to the local system. I agree
> that there are some nice properties. If the commit fails after
> committing, but before pulling, you just 'bzr pull' and you are up to date.
Well, here are some more items for discussion.
1) When binding, both the local branch and the remote branch are
updated. This is to make it nice when you have
A bound to B
commit
commit
A unbind
A commit
A commit
A bind B
# Now both A and B are up-to-date, because A updated B
I think we want to support this, because it makes working with bound
branches easier.
Now the question is, I think binding to B should update the A's working
directory (same as 'pull').
But should binding to B update B's working directory? This obviously
could only happen on the local filesystem right now.
Part of me says yes, and part of me says no. Right now I'm leaning
towards no. Since B is essentially its own branch. And we don't really
want to update B at commit time either.
This brings up:
2) Should WorkingTree have a bind() method. When you bind, you want to
update your local working tree if you have one. I could put the
working_tree.pull() command into cmd_bind(), but it also seems to fit in
Branch.bind(). If we don't have a working tree, we still want to do
Branch.pull(), and I think Branch.bind() should handle the invariants
that the branches have been pulled up to date, and not require callers
to do so.
This violates bzrlib/tests/test_source.py which says
# do not even think of increasing this number. If you think you need to
# increase it, then you almost certainly are doing something wrong as
# the relationship from working_tree to branch is one way.
The problem I have is that WorkingTree's aren't really bound, so giving
them a bind() method doesn't really make sense. In the future we will
add checkouts, which might have something similar to bind, but it is a
very different concept. (certainly I could see you re-targeting a checkout).
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051230/348c5a34/attachment.pgp
More information about the bazaar
mailing list