Question

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?

Was it helpful?

Solution

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)

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top