Bound branch implementation

John A Meinel john at arbash-meinel.com
Sun Nov 13 05:28:11 GMT 2005


Ivan Krstic wrote:
> John A Meinel wrote:
>> # Someone commits to /path/to/other/branch in the meantime
>> $ bzr commit -m "Another new feature"
>> bzr: ERROR: Remote branch has been updated, use bzr pull to update
>> $ bzr pull
> 
> I think I'm missing something - how can a pull succeed if there are
> local changes? Shouldn't this be a merge instead? E.g.:

Actually, yes, a pull will succeed if there are local changes. It pulls
the updated history, and then merges the changes into the working tree.

> 
> $ bzr commit -m "Another new feature"
> bzr: ERROR: Remote branch has been updated. Use bzr merge to synchronize
> the changes. Merge now? [Y/n]
> 
>> # If nothing was committed, this will push your changes
>> # to the remote tree, and leave you back in the bound state
>> # Otherwise you will get:
>> bzr: ERROR: Trees have diverged. You must merge, and push the changes
> 
> Since it's going to be the most common course of action, I propose
> adding a merge-now prompt here, as well.
> 
>> $ bzr merge
>> $ bzr commit -m "Joining trees"
>> $ bzr push # Add the joining revision to the remote tree
>> $ bzr bind # This should succeed,
>>            # and set local revision-history = remote revision-history
> 
> That push looks superfluous to me. In the case where the remote branch
> hasn't changed, 'bind' does a push already. I think we should detect the
> case where there were commits to the remote branch which have now been
> merged locally, and make 'bind' do the push by itself.
> 

It might actually work that way. It depends on how smart the pull logic
is. Since we already are able to achieve convergence, I think it will
just work.

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/20051112/825bd764/attachment.pgp 


More information about the bazaar mailing list