11

Using tortoise hg on windows, I did a pull from a repository on my local drive to a repository on a usb stick.

During the pull i guess there was a glitch in the usb-connection because it got aborted half way through.

Now i can't pull again. I get the message: abandoned transaction found - run hg recover

When i run hg recover i get the following message:

rolling back interrupted transaction
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
** Mercurial Distributed SCM (version 1.6.3)
** Extensions loaded: fixfrozenexts
Traceback (most recent call last):
  File "hg", line 36, in <module>
  File "mercurial\dispatch.pyo", line 16, in run
  File "mercurial\dispatch.pyo", line 34, in dispatch
  File "mercurial\dispatch.pyo", line 54, in _runcatch
  File "mercurial\dispatch.pyo", line 494, in _dispatch
  File "mercurial\dispatch.pyo", line 355, in runcommand
  File "mercurial\dispatch.pyo", line 545, in _runcommand
  File "mercurial\dispatch.pyo", line 499, in checkargs
  File "mercurial\dispatch.pyo", line 492, in <lambda>
  File "mercurial\util.pyo", line 420, in check
  File "mercurial\commands.pyo", line 2869, in recover
  File "mercurial\localrepo.pyo", line 606, in recover
  File "mercurial\transaction.pyo", line 173, in rollback
ValueError: too many values to unpack

If i try to rollback manually i get this message: no rollback information available

This time i can quite easily just delete the whole backup on my stick and do a fresh pull because the repo is small and the usb-stick does not contain any other changes. But what if this happens on a larger repo where i can't afford to restart from scratch? How can i recover the repo?

ice
  • 111
  • 1
  • 1
  • 3
  • There is no guarantee that recovery will be able to handle all types of corruption, sometimes your repository really is hosed beyond repair, and a backup/reclone is all you can do. I assume you're ensuring you always ask Windows to eject/close your USB drive before unplugging it? – Lasse V. Karlsen Apr 03 '11 at 21:34
  • 3
    Of course i always try to do safe removal but this time the wire was attached loosely. Can this really cause the whole repo to go out of control? I thought everything was done with transactions ala sql so you could always roll back if something goes bad. – ice Apr 05 '11 at 20:54

3 Answers3

5

I experienced a similar issue and reported it as a bug, and the developer on the report suggested the problem is a corrupt journal. As described in the bug report, you can run hg verify to see the last "good" commit, and use hg clone -r <#> to recover up until that commit.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
eykanal
  • 26,437
  • 19
  • 82
  • 113
4

I think this is actually a bug in the code source. You should report the error to the Mercurial team like said in the error message.

krtek
  • 26,334
  • 5
  • 56
  • 84
  • 1
    I agree. Had the same issue for mercurial version `3.0+3`- reverted to version `2.5.2`: https://bitbucket.org/tortoisehg/files/downloads/tortoisehg-2.7.1-hg-2.5.2-x64.msi and the rollback command passed. – qbik Jul 10 '14 at 11:07
0

I was using the TeamCity CI and Deployment server, so, probably, this is another issue, but I have posted the answer to the similar question.

Community
  • 1
  • 1
ivan.mylyanyk
  • 2,051
  • 4
  • 30
  • 37