Data loss after failed uncommit & pull

Asked by Marten de Vries

(copied from IRC):

Hi, I've just done a bzr commit -m "commit message" while I had deleted some files inside my repo. Then, I did bzr uncommit because I forgot to pull from launchpad first. It gave an error containing the file name of one of the files I deleted, and now all files are the same as in the latest rev. of the bzr branch. In other words: all my changes are gone. Does anyone know how to recover them? (if possible?)

http://paste.ubuntu.com/5662203/ <- .bzr.log relevant entries.
the pull modifies the files I changed (most importantly: modules/org/openteacher/websiteGenerator/websiteGenerator.py)

I hope someone can help me, there are two days of work in that file :(.

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Marten de Vries
Solved:
Last query:
Last reply:
Revision history for this message
John A Meinel (jameinel) said :
#1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-03-30 23:11, Marten de Vries wrote:
> New question #225506 on Bazaar:
> https://answers.launchpad.net/bzr/+question/225506
>
> (copied from IRC):
>
> Hi, I've just done a bzr commit -m "commit message" while I had
> deleted some files inside my repo. Then, I did bzr uncommit because
> I forgot to pull from launchpad first. It gave an error containing
> the file name of one of the files I deleted, and now all files are
> the same as in the latest rev. of the bzr branch. In other words:
> all my changes are gone. Does anyone know how to recover them? (if
> possible?)
>
> http://paste.ubuntu.com/5662203/ <- .bzr.log relevant entries. the
> pull modifies the files I changed (most importantly:
> modules/org/openteacher/websiteGenerator/websiteGenerator.py)
>
> I hope someone can help me, there are two days of work in that file
> :(.
>

Since you had committed (before the uncommit), you have this entry:
Uncommitting from {<email address hidden>}
to {<email address hidden>}

You should be able to do something like:

bzr branch /home/marten/bzr/3.x /home/marten/bzr/3.x-test -r
revid:<email address hidden>

That should create a branch for you at the point before you did the
uncommit.

At which point you can make sure your branch is up-to-date with trunk
(pull, whatever), and pristine, and then bzr merge ../3.x-test.

Also, when bzr deletes/reverts files, if it sees the content is
unreproducible (not simply the state from an update, but locally
modified), it will produce a "foo.~1~" sort of file. Which should
contain whatever local modifications you had before the pull/revert/etc.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlFXQLIACgkQJdeBCYSNAAO3iACgqhk5N3MH41DRHg36PAPtcKQ7
wu0AnAzlxIiv6wUj2yvp5n1uxA19vC4P
=f329
-----END PGP SIGNATURE-----

Revision history for this message
Marten de Vries (marten-de-vries) said :
#2

The ~1~ files were not there, but the branching of a specific revid worked. Got my data back :)

If the failed uncommit is a bug, I can provide the branch for investigation if you want. Just subscribe me to the bug report if that happens to be the case.

Thanks a lot.