[PATCH] push to diverged branch

Martin Pool mbp at canonical.com
Mon Oct 16 06:08:50 BST 2006


On 10 Oct 2006, Erik Bågfors <zindar at gmail.com> wrote:
> I'm not sure I like this message. Take the following example
> I run
> bzr branch sftp://foobar/trunk featureX
> cd featureX
> hack; commit; hack; commit
> bzr push
> 
> I now get the message  'Try using "merge" and then "push"', so I do that
> bzr merge
> 2000 revision has been merged
> Since I know something about bzr i run commit, eventhough the message
> didn't tell me to (shouldn't it?)
> I have now merged these 2000 revisions into my 2 revision feature-branch
> bzr push
> And suddenly, I've converted the last 2000 revisions of trunk into
> something that's merge in.
> 
> I don't think that's right, and I think it will confuse people alot.

('bzr push' alone won't push back to the place you branched from.
You need to give the url.)

I agree in this situation it may be desirable to have the trunk see your
changes as merged-in, rather than vice versa.  This is easy to achieve
using a checkout of mainline.  Or you can make a new branch from the tip,
merge, and push (which simulates a checkout.)

It might be nice if you could do an 'update' from trunk into featureX,
making your new work into pending merges in the working tree, rebased
onto the tip of trunk.  After committing that, unless someone else
committed in the meantime, you could then push to the trunk.  This
doesn't allow anything that's not already possible but it would make
checkouts and branches more uniform.

-- 
Martin




More information about the bazaar mailing list