bzr revert after bzr update loses history in 2.0.2

Asked by Kristian O'Dempsey

I am using the version 2.0.2 of bazaar on my windows workstation and version 2.0.1 on a linux server using the bzr smart server protocol. It has worked perfectly up until I installed version 2.0.0.

Here is my scenario:

1) Create a shared repository
2) Create a branch under that shared repository
3) Add some files and commit
4) Push the branch to remote branch
5) Bind to the remote branch
6) Commit a few revisions with some changes
7) Unbind from remote branch
8) Commit a few revisions locally with some changes
9) Bind to remote branch again
10) Do a bzr update

(note: all this was done through bzr explorer, though I have no reason to believe it wouldn't also occur via the command line)

At this point, I find my local tip back at the last revision of the master branch, with a small branch of my local commits as a pending merge. If I then do a bzr revert, I discover that i've lost all revisions after the tip of the master branch - ie. all my local commits!!

Am I missing something? I lost a days work in about 3 mouse clicks, that simple. If I do a standard revert, I expect that it will restore my working tree to the head revision. I suspect that the update in this case has apparently lopped local revisions off and deemed them to be part of my working tree - which was removed with the revert.

Is this not blatantly destroying history? Is there no way to recover those revisions?

In my opinion, it should be a lot harder than that to permanently destroy history, if in fact that is what has happened.

Regards,

Kristian

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Marius Kruger
Solved:
Last query:
Last reply:
Revision history for this message
Best Marius Kruger (amanica) said :
#1

I'm sorry if its a bit late, but you can get it back. You need the
bzrtools plugin then you can do something like the following on the
command-line:

Find your precious revisions:
$ bzr heads --dead-only
HEAD: revision-id:
<email address hidden> (dead)
  committer: Marius Kruger <email address hidden>
  branch nick: checkout
  timestamp: Mon 2009-11-30 17:43:42 +0200
  message:
    y

Update your tree to it (using the revision-id of the revision you want) :
$ bzr pull -r revid:<email address hidden>
.

The problem is that your update converted local commits into pending
merges, which had to be committed.
Then the revert removes pending merges.

Revision history for this message
Marius Kruger (amanica) said :
#2

also note from `bzr help revert` :
The working tree contains a list of pending merged revisions, which will
  be included as parents in the next commit. Normally, revert clears that
  list as well as reverting the files. If any files are specified, revert
  leaves the pending merge list alone and reverts only the files. Use "bzr
  revert ." in the tree root to revert all files but keep the merge record,
  and "bzr revert --forget-merges" to clear the pending merge list without
  reverting any files.

Revision history for this message
Kristian O'Dempsey (kodempsey) said :
#3

Ahh, that makes more sense. Thanks Marius. It will be handy to get those revisions back.

It would be nice if bzr explorer covered a few more options with it's available commands - like revert, perhaps even made context sensitive so bound branch reverts are different by default to unbound branch reverts. All in good time i guess.

Regards,

Kristian

Revision history for this message
Kristian O'Dempsey (kodempsey) said :
#4

Thanks Marius Kruger, that solved my question.