all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bzr help
@ 2013-12-20 16:53 Tassilo Horn
  2013-12-20 18:05 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tassilo Horn @ 2013-12-20 16:53 UTC (permalink / raw
  To: emacs-devel

Hi all,

it seems I've done something wrong, and now I've messed up my checkout a
bit.

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".  When I
wanted to push then, I got:

--8<---------------cut here---------------start------------->8---
Using saved push location: bzr+ssh://tsdh@bzr.savannah.gnu.org/emacs/trunk/
bzr: ERROR: Server sent an unexpected error: ('error', 'AppendRevisionsOnlyViolation', 'Operation denied because it would change the main history, which is not permitted by the append_revisions_only setting on branch "filtered-172644364:///emacs/trunk/".')
--8<---------------cut here---------------end--------------->8---

With "bzr log" I can see that the commit in between (Bozhidar's rename
of helpers.el to subr-x.el) isn't there separately but it seems like
I've done that myself!

--8<---------------cut here---------------start------------->8---
% bzr log --verbose 
------------------------------------------------------------
revno: 115646 [merge]
committer: Tassilo Horn <tsdh@gnu.org>
branch nick: trunk
timestamp: Fri 2013-12-20 17:28:07 +0100
message:
  merge with trunk
removed:
  lisp/emacs-lisp/helpers.el
added:
  lisp/emacs-lisp/subr-x.el
modified:
  etc/NEWS
  lisp/ChangeLog
------------------------------------------------------------
revno: 115645
committer: Tassilo Horn <tsdh@gnu.org>
branch nick: trunk
timestamp: Fri 2013-12-20 17:24:41 +0100
message:
  Document that =, <, <=, >, >= now accept one or many arguments.
  
  * doc/lispref/numbers.texi (numbers): Document that =, <, <=, >, >= now accept
  one or many arguments.
modified:
  doc/lispref/ChangeLog
  doc/lispref/numbers.texi
  etc/NEWS
------------------------------------------------------------
--8<---------------cut here---------------end--------------->8---

"bzr missing" now shows me Bozhidar's commit.

--8<---------------cut here---------------start------------->8---
You are missing 1 revision:
------------------------------------------------------------
revno: 115646
committer: Bozhidar Batsov <bozhidar@batsov.com>
branch nick: master
timestamp: Fri 2013-12-20 18:37:10 +0200
message:
  * lisp/emacs-lisp/subr-x.el: (string-remove-prefix): New function.
  (string-remove-suffix): New function.
--8<---------------cut here---------------end--------------->8---

Ups, I've thought another "bzr merge" and "bzr commit" would probably
work, but now I have two merge commits on top.

--8<---------------cut here---------------start------------->8---
------------------------------------------------------------
revno: 115647 [merge]
committer: Tassilo Horn <tsdh@gnu.org>
branch nick: trunk
timestamp: Fri 2013-12-20 17:43:23 +0100
message:
  merge again
modified:
  etc/NEWS
  lisp/ChangeLog
  lisp/emacs-lisp/subr-x.el
------------------------------------------------------------
revno: 115646 [merge]
committer: Tassilo Horn <tsdh@gnu.org>
branch nick: trunk
timestamp: Fri 2013-12-20 17:28:07 +0100
message:
  merge with trunk
removed:
  lisp/emacs-lisp/helpers.el
added:
  lisp/emacs-lisp/subr-x.el
modified:
  etc/NEWS
  lisp/ChangeLog
------------------------------------------------------------
revno: 115645
committer: Tassilo Horn <tsdh@gnu.org>
branch nick: trunk
timestamp: Fri 2013-12-20 17:24:41 +0100
message:
  Document that =, <, <=, >, >= now accept one or many arguments.
  
  * doc/lispref/numbers.texi (numbers): Document that =, <, <=, >, >= now accept
  one or many arguments.
modified:
  doc/lispref/ChangeLog
  doc/lispref/numbers.texi
  etc/NEWS
--8<---------------cut here---------------end--------------->8---

Now "bzr missing" tells me I have 3 extra revisions.  It doesn't
complain anymore about Bozhidar's commit missing, although that's still
missing from the log.

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

And what did I do wrong in the first place?

Thanks,
Tassilo



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bzr help
  2013-12-20 16:53 Bzr help Tassilo Horn
@ 2013-12-20 18:05 ` Eli Zaretskii
  2013-12-20 18:47   ` Tassilo Horn
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2013-12-20 18:05 UTC (permalink / raw
  To: Tassilo Horn; +Cc: emacs-devel

> From: Tassilo Horn <tsdh@gnu.org>
> 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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bzr help
  2013-12-20 18:05 ` Eli Zaretskii
@ 2013-12-20 18:47   ` Tassilo Horn
  2013-12-20 20:37     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tassilo Horn @ 2013-12-20 18:47 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

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

Ok, I see.

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

Guessed correctly, though I usually just "git pull --rebase".

> Instead, use a bound branch, and the workflow described in
> http://www.emacswiki.org/emacs/BzrForEmacsDevs.

Yes, I'll do so.

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

Yes, that seems to be the best solution for how I'm used to work.

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

No, not the first time.  I usually just edit, then review/commit with
`vc-dir', and then "bzr push" in a console.  Up to now, I was just lucky
that nobody pushed in between.

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

I simply uncommitting my 3 top-most commits which left me in a state
where the original change I wanted to do was the only change in my
working copy.  So I could just commit them again and push.

Thanks for the help, Eli!
Tassilo



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bzr help
  2013-12-20 18:47   ` Tassilo Horn
@ 2013-12-20 20:37     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2013-12-20 20:37 UTC (permalink / raw
  To: Tassilo Horn; +Cc: emacs-devel

> From: Tassilo Horn <tsdh@gnu.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 20 Dec 2013 19:47:01 +0100
> 
> > 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.
> 
> Guessed correctly, though I usually just "git pull --rebase".

With bzr, the equivalent is "bzr merge".

> Thanks for the help, Eli!

You are welcome.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-20 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 16:53 Bzr help Tassilo Horn
2013-12-20 18:05 ` Eli Zaretskii
2013-12-20 18:47   ` Tassilo Horn
2013-12-20 20:37     ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.