[PATCH] push to diverged branch

Erik Bågfors zindar at gmail.com
Tue Oct 10 08:21:49 BST 2006


On 10/8/06, John Arbash Meinel <john at arbash-meinel.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Matthieu Moy wrote:
> > Hi,
> >
> > Trying to "bzr push" to a diverged branch, bzr says:
> >
> > $ bzr push
> > Using saved location: sftp://my.remote/branch/
> > bzr: ERROR: These branches have diverged.  Try a merge then push with overwrite.
> >
> >
> > Indeed, it's not necessary to use --overwrite after the merge, since
> > the current revision becomes a successor of the tip of the branch to
> > push to. I think it's a very bad idea to encourrage people to use this
> > potentially dangerous option. I think the message should be fixed to
> > something like:
> >
> > === modified file 'bzrlib/builtins.py'
> > --- bzrlib/builtins.py2006-09-27 12:50:58 +0000
> > +++ bzrlib/builtins.py2006-10-07 13:22:24 +0000
> > @@ -645,7 +645,7 @@
> >                      count = tree_to.pull(br_from, overwrite)
> >              except DivergedBranches:
> >                  raise BzrCommandError("These branches have diverged."
> > -                                      "  Try a merge then push with overwrite.")
> > +                                      "  Try using \"merge\" and then \"push\".")
> >          note('%d revision(s) pushed.' % (count,))
> >
> >          if verbose:
>
> +1 on the change. In the past, the check was only on mainline revisions
> (it didn't check ancestry) so you did indeed have to supply --overwrite.
>
> But as you notice, that isn't the case anymore.
>
> I probably would change it to:
>
> ' Try using "merge" and then "push".')

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.

Regards,
Erik




More information about the bazaar mailing list