3

I have been happily using HgSubversion for awhile and today I forgot to add the --svn to the rebase command. Now i get the dreaded unknown revision ''

Is there a way to recover from this?

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229
Adam Mills
  • 7,719
  • 3
  • 31
  • 47
  • A traceback would be helpful, could you run the command with `--traceback`? – Martin Geisler Jan 16 '12 at 15:59
  • Also, when do you get the "dreaded unknown revions xxx"? Any chance you rebased "converted revisions" on top of local (non-pushed yet) ones, or something similar? – pmezard Jan 16 '12 at 16:01
  • I have blown away the repository now. I pulled changes (there was one new revision) rebased without --svn (i had 2 non-pushed revisions). Then I tried to push.. error. Tried to pull...error – Adam Mills Jan 16 '12 at 18:02

2 Answers2

5

You should be able to do "hg svn rebuildmeta" and then do "hg pull" and have it repair things.

Note: this is untested, so I'd work on a duplicate of the local repo in case it screws things up. My memory of the code suggests this will work.

durin42
  • 1,447
  • 8
  • 10
1

I'd try using the transplant extension to fix this:

  1. Re-clone the SVN repository to a new local repository.
  2. Examine the history of the original repository and note which changes need moving
  3. Transplant the changes from the old repository to the new repository

For example - fixing an hgsubversion repo called project:

> hg clone svn+http://svnrepo/project project-tmp

Then examine the log of your original project folder and do the following from the project-tmp folder:

> hg transplant -s ../project 1234

Where 1234 is the revision that you want to move over. Repeat this until all your revisions are copied.

When you're done you should be able to start using the new folder in place of the old folder by re-pulling from SVN, rebasing your changes and push them back (don't forget --svn)

Steve Kaye
  • 6,262
  • 2
  • 23
  • 27
  • I'll mark as the answer. But I was really hoping for a solution that didn't require a full re-clone, due to being remote. I'll keep a backup copy for these sorts of times. – Adam Mills Jan 19 '12 at 12:36