Bound branch implementation
John A Meinel
john at arbash-meinel.com
Mon Nov 14 14:39:16 GMT 2005
Erik Bågfors wrote:
> 2005/11/13, John A Meinel <john at arbash-meinel.com>:
>> One use case that comes up fairly often is wanting to have a public
>> location where people can download your branches, while still having a
>> local branch that you can use offline.
>> Also, frequently people want to have some sort of centralized
>> development, where they have a shared branch that multiple people can
>> commit to. In this sort of mode, you have to update your local tree
>> before you can commit.
>>
>> So, I think I have an implementation which works. It is built off of
>> Robert's integration branch, and is available from here:
>> http://bzr.arbash-meinel.com/branches/bzr/bound-branch/
>>
>> Eventually, we want to put this into bzr core, but first I would like to
>> get some feedback. I made sure committing when bound has a decent error
>> message, but I'm not sure that I've tracked down all the other
>> possibilities.
>>
>> My test cases work, indicating the functionality is there, but that
>> doesn't mean the user interface is perfect. Also, I believe it will fail
>> when bound to a remote tree, since we can't update remote WorkingTrees.
>> I don't know if we will support updating remote trees, or just creating
>> branches without remote working trees.
>>
>> But if you're willing, play around with it.
>
> I just played around with this and all I can say is.... WOW! This is
> just amazing.
>
> I really don't think the user interface is that terrible except when
> you bind back to a branch after being unbounded for a while. What you
> have to do then is
> $ bzr merge [ this defaults to the right branch ]
> $ bzr ci -m 'merge'
> $ bzr push sftp:// [ this doesn't default to the right branch ]
> $ bzr bind
>
> So that's four commands to rebind. I'd like to simplify that, but at
> the same time you have to do a commit manually (since you might have
> to solve some conflicts). Perhaps "bzr bind" should try to push first
> if possible.
I thought that bind might already be doing that last push. I know if you
have regular commits, and there are no remote changes, then the bind
will push them. But it may not be smart enough to handle a merged change
yet.
That would make it:
$ bzr bind
Cannot bind, you must merge first
$ bzr merge
$ bzr commit -m "merge"
$ bzr bind
Yes, we could have bind run merge if it fails, but I don't prefer having
bind modify my working tree. That is why we have merge. And certainly I
don't want it to commit the merge until I've looked over it.
I realize some people are frustrated by having to run a command which
bzr knows you need to run. We might be able to do something interactive.
So that if the command fails, it prompts you if you want to run the
alternative command.
I've stayed away from interactive because it isn't proper behavior for
shell commands. However, as a user interface, they can be nice. And
we've been discussing separating out the scripting front-end from the
user front-end.
John
=:->
>
> That way if no changes to the remote branch
> $ bzr bind
> bzr: changes have been pushed, you are now bounded.
>
>
> If there are changes to the remote branch
>
> $ bzr bind
> bzr: ERROR: These branches have diverged. Try merging and commiting.
>
> $ bzr merge
> $ bzr commit -m merged'
> $ bzr bind
> bzr: changes have been pushed, you are now bounded.
>
> That way you don't have to do the push-thing at least, but just the
> "normal" merge/commit operation.
>
> But maybe it can be made even better.
>
> Regards,
> Erik
>
-------------- 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/20051114/b25ec9be/attachment.pgp
More information about the bazaar
mailing list