emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bzr help


From: Eli Zaretskii
Subject: Re: Bzr help
Date: Fri, 20 Dec 2013 20:05:53 +0200

> From: Tassilo Horn <address@hidden>
> Date: Fri, 20 Dec 2013 17:53:48 +0100
> 
> I've been documenting another item from etc/NEWS, and committed my
> changes (no bound branch).  When I wanted to bzr push, I got a message
> that the branches have diverged.
> 
> I've done "bzr pull" and "bzr merge" followed by a "bzr commit".

That was a mistake: "bzr pull" in a diverged branch doesn't do what
you think it does (bzr is not git).  The first line of "bzr help pull"
says:

  Purpose: Turn this branch into a mirror of another branch.

which is not what you want.

What you want is "bzr merge" from the remote branch, followed by "bzr
commit".  _Then_ you should be able to push.  IOW, omit the "bzr pull"
from the sequence of the commands, and you should be fine.

Having said that, I really don't recommend working from an unbound
branch, it will make things harder for you, due to subtle differences
in semantics of name-sake commands to which you are used to with git.
Instead, use a bound branch, and the workflow described in
http://www.emacswiki.org/emacs/BzrForEmacsDevs.  That way, you will
have recipes for commands that DTRT.  You can use local branches
(described on that page as well), if you prefer that, and merge onto
the bound branch immediately prior to committing (pushing) upstream.
This workflow has a much lower risk of causing damage both to your
branches and to the remote trunk.

Btw, is this the first time you did some local commits and tried to
push?  If not, how did your workflow look until now?

> How do I get back into a good, pushable state, preferably without losing
> my commit 115645 (or at least the changes)?  (I haven't tried pushing in
> fear of being able to screw things up.)

I think "bzr uncommit" in your branch will be able to remove all the
mistaken commits you've made, either one by one or all of them at once
(see "bzr help uncommit").  Then start over, this time correctly.  To
avoid losing your changes, save them first with "bzr diff -c REVNO",
and then you will be able to reapply them.

Another idea is to "bzr branch -r REVNO" a new branch, starting from
the revision before the screwup.  Then do everything again in the new
branch, this time correctly, and push from that.  You can then delete
the previous branch (or not, if you are afraid ;-)

Yet another idea is to save the changes with "bzr diff" as mentioned
above, then "bzr pull --overwrite" from upstream, followed by "bzr up"
which will give you a mirror of the current trunk.  Then reapply your
documentation changes and push.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]