Bound branch implementation

Ivan Krstic krstic at hcs.harvard.edu
Sun Nov 13 05:03:52 GMT 2005


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.:

$ 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.

-- 
Ivan Krstic <krstic at hcs.harvard.edu> | 0x147C722D




More information about the bazaar mailing list