Problem Converting from Subversion to Mercurial

15 views
Skip to first unread message

Todd Greer

unread,
Aug 22, 2012, 11:18:17 AM8/22/12
to merc...@selenic.com

I’m having a bit of difficulty with a conversion from a particular Subversion repository, and I would be very grateful if anyone could offer some useful advice.

 

The svn repo in question has several different projects, and used a somewhat nonstandard layout. Each project had it’s own “trunk” and “branches” (though the latter mostly stores what the team considers tags). Every time they started development towards a new release, they copied the trunk of every relevant project to a new directory, and created a new “branches” directory next to it. I’ll illustrate:

 

/product1/

1.0/

                project1/

trunk/

branches/ (several copies of ../trunk)

project2/

                trunk/

                branches/ (several copies of ../trunk)

2.0/

                project1/

                                trunk/ (copied from /product1/1.0/project1/trunk, then developed on)

                branches (several copies of ../trunk)

                                project2/

                                                trunk/ (copied from /pro duct1/1.0/project2/trunk, then developed on)

                                                branches (several copies of ../trunk)

                3.0/ (same layout)

/product2/ (various layouts)

 

My initial approach was to run 1 conversion per project, pointing at the latest version of product1, in the simplest way (“hg convert svn://x.x.x.x//product1/3.0/project1”, etc.). For most of the projects, this appears to have worked flawlessly, but for a few, it fails, saying “abort: no revision found in module /product1/3.0/project1/trunk”.

 

I’m using Hg version 2.0.2 on Windows via the TortoiseHg installer. The only additional configuration I’m giving convert is an –authors map, but I’m assuming that’s irrelevant. I haven’t noticed anything special about the projects that fail, but I’m guessing convert tripping up on one of the places where directories are copied and/or deleted (and in some cases created by copy, then deleted, then re-created by copy from the same place).

 

If you can offer any advice (that doesn’t involve a time machine), I will greatly appreciate it.

 

Thank you,

Todd

 

Description: cid:72965558-AF04-45FF-B811-584C9FA3C338

Todd Greer, Director of Development, Affinegy, Inc.
1705 S. Capital of Texas Hwy, Ste. 310, Austin, TX, 78746
512.535.1700 | F 512.233.2477

tgr...@affinegy.com    http://affinegy.com

 

Greg Ward

unread,
Sep 1, 2012, 5:20:51 PM9/1/12
to Todd Greer, merc...@selenic.com
On 22 August 2012, Todd Greer said:

> I'm having a bit of difficulty with a conversion from a particular
> Subversion repository, and I would be very grateful if anyone could
> offer some useful advice.
>
> The svn repo in question has several different projects, and used a
> somewhat nonstandard layout. Each project had it's own "trunk" and
> "branches" (though the latter mostly stores what the team considers
> tags). Every time they started development towards a new release, they
> copied the trunk of every relevant project to a new directory, and
> created a new "branches" directory next to it. I'll illustrate:

Mercurial's svn conversion assumes the standard /trunk, /branches,
/tags layout. Diverge from that and results are ... ummm ...
undefined.

As a quick hack, you could just modify hgext/convert/subversion.py and
change it to have a hardcoded assumption of *your* svn repository's
layout. If you get ambitious, refactor it so other users can specify
source svn layouts more flexibly ("project trunk is here, branches are
there") and send in a patch!

Greg
_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Petriconi, Felix

unread,
Sep 4, 2012, 3:36:55 AM9/4/12
to Todd Greer, merc...@selenic.com

Hi Todd,

 

first my blog regarding the conversion to Hg from SVN might help you: http://petriconi.net/?p=10

 

My biggest recommendation is here, to perform the complete conversion under Linux. Not under Windows, because at least for me not all SVN tools work properly on Windows XP/Server 2003.

I tried to get real branches transferred into Hg, but that did not work for me. So we choose those few branches that we really might need. At the end we only needed only the very last branch. We kept the SVN server still running to look into the past. So perhaps you should rethink, if you really need all the old branches.

 

I hope this helps, regards, Felix

 

Felix Petriconi

Development Manager

Certified Scrum Master (CSM)

 

MeVis BreastCare Solutions GmbH & Co. KG

A MeVis Medical Solutions company

Universitaetsallee 29

28359 Bremen

Germany

Phone: +49 (0)421 33074-(9)20

Fax:      +49 (0)421 33074-50

 

E-mail: felix.p...@mevis.de

Website: www.mevis.de

 

Trade Registry: Bremen HRA 25204 HB

VAT ID: DE262661277

 

Executive Board:

Marcus Kirchhoff, Dr. Robert Hannemann

MeVis BreastCare Solutions Verwaltungs-GmbH

Reply all
Reply to author
Forward
0 new messages