Fix HgSubversion Repo after Rebase without --svn

433 views Asked by At

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?

2

There are 2 answers

1
Steve Kaye On BEST ANSWER

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)

1
durin42 On

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.