[PATCH] push to diverged branch

Matthieu Moy Matthieu.Moy at imag.fr
Sat Oct 7 14:25:16 BST 2006


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:

(the quotes insist on the fact that they are command names)

(BTW, is "push --overwrite" really useful?)

Then, I got something funny (but IIRC this is a known bug):

$ bzr push
Using saved location: sftp://my.remote/branch/
-1 revision(s) pushed.
$

-- 
Matthieu




More information about the bazaar mailing list