Steps required for hgsubversion SVN clone to drop back

I am working on a team that uses SVN in the first place, while I prefer to use Mercurial when possible. I installed the hg clone of the SVN repo using hgsubversion, and several basic pulls / commits / push seemed to work fine.

Now, after 2 weeks of local development (during which I combined in the changes from the external hg repository and repeatedly merged in the changes from the SVN repo), I tried to click on the SVN repo, but this message failed:

abort: Sorry, I can not find the svn parent to verify the merge.

I found other users facing the same problem with practical recommendations on how to avoid this problem in the future, but I did not come across anything that seems to be related to the condensation of several concurrent transactions to clear the existing hgsubversion repository .

What is the best way I can rectify the situation without losing my own obligations? (Step by step instructions?)

+7
source share
1 answer

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--S2--S3--C1--C2--S4--S5--C3-C4--C5--C6--C7--S6--S7 

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« .

+9
source

All Articles