Converting from inorgnised Subversion Repo

Igor Lautar igor.lautar at gmail.com
Fri Dec 18 07:02:49 CST 2009


Hi,

On Fri, Dec 18, 2009 at 1:31 PM, sridher <jakku.sridher at yahoo.com> wrote:
> Hi all,
> In our organization we are using subversion since 3years. primarily we used
> the repo without any structure some time
>
> ---->Repo
>
> after some time
> Later we changed the structure to
>
> ---->Repo|-trunk
>              |-branches
>              |-tags
>
>
> after some time the application gone big so we added modules
> Later we changed the structure to
>
>
> ---->Repo|-trunk
>              |-branches
>              |-tags
>              moduleone|-trunk
>                            |-tags
>                            |-branches
>              moduletwo|-trunk
>                            |-tags
>                            |-branches
>              moduleth3|-trunk
>                            |-tags
>                            |-branches
>
> how can i convert this project to Repo/subrepos(hg) without lossing any
> revisons

Well, interesting problem :)

But I think it could be solved using hg convert and filemaping.

Lets say those 3 periods (where you changed layout) are identified by revisions:
r1 -> initial revision
r2 -> revision where first layout change occurred
r3 -> revision where second layout change occurred

Now, do hg convert of Repo from r1 up to r2, but specify correct
filemap (ie, if you have folder named Folder in Repo, than you
probably want it named Folder in new hg repo, so no need to have
filename in this case).
Then do r2 to r3, but change filemap (so trunk/Folder now becomes
Folder). This will add history to previous 'Folder'.

Repeat the same for r3 -> now, again changing filemap.

This would solve for trunk. Of course, you would have to repeat all of
this for each branch (and using branchmap mapping to get branch name
correctly).

Also, you might want to use different hg repositories for modules, ie.
one per module. In that case, you could have common history for all
and then just add different history depending on module. This would be
somehow easier than doing it all in one hg repo.

This will take a lot of manual exercise to do it correctly, but it
should not be impossible.

Regards,
Igor


More information about the Mercurial mailing list