You cannot drag hg into the subversion repository, since SVN cannot understand them. You need to reinstall your changes on top of the last SVN commit.
Edit Steps to smooth history:
Warning, be prepared to do a lot of merge conflicts
You need to activate the mq and rebase extension
The first step is to create a backup repo, as you will need it as a link for upcoming merge conflicts (expect many of them).
Say your schedule is as follows:
C1--C2--C3------M1--C5--C6--C7---M2-- \ / \ / \--B1--B2--/ \--B3--B4-B5-/
Then the second step is to reinstall B1 + B2 on top of C3: hg rebase -b B2 -d C3
-b use the common base of both branches as the start of the branch for forwarding, so mercurial finds that B1 is the first deviation lock and uses this even when you say that B2 is rebalanced. -d indicates the destination of the reinstalled branch.
If you encounter merge conflicts, then make sure that the result is B2 '= M1, otherwise you will get a lot of conflicts in future versions.
Then Merge M1 disappeared and your chart looks like this:
C1--C2--C3--B1'--B2'--C5'--C6'--C7'---M2'-- \ / \--B3'--B4'-B5'-/
and now you do the same for the second merge: hg rebase -b B3' -d C7' , which makes your repo as follows:
C1--C2--C3--B1'--B2'--C5'--C6'--C7'--B3''--B4''--B5''
Repeat until you get the full history of linear versions.
After you have smoothed the history, you need to reorder your commits on top of svn transactions. Let's say your repo now looks like this (S = transaction subversion, C = local commit):
S1
Now you import everything from (including) C1 into the mercury queue ( hg qimport -rC1: . Use hg qseries to view all created patches.
Then you remove all patches ( hg qgoto C1.diff [this is the first one in qseries] , and then hg qpop ). Then you delete the subversion ( hg qdelete S4.diff S5.diff S6.diff S7.diff ).
Now it's time to re-fetch svn ( hg pull »svn-remote« ). Then you reapply all the local fixes, one after the other with hg qpush , and fix all the merge conflicts that are currently happening. When you are finished with one conflict, you can move the current patch to mercurial commit using hg qfinish -a and send the current state using hg push »svn-remote« .