Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import an svn repo into a mercurial one?

Tags:

svn

mercurial

I'm using the convert extension, so am not sure if it's the right tool, since:

hg convert svn://svn blah

gives:

svn://blah does not look like a Subversion repository

How do I do this, assuming that my repo doesn't have anonymous access?

like image 379
tshepang Avatar asked Oct 14 '22 20:10

tshepang


People also ask

How do I export and import SVN repository?

In the main menu, select VCS | Browse VCS Repository | Browse Subversion Repository to open the SVN Repositories tool window. Right-click a directory you want to export and choose Export from the context menu. In the Select Path dialog that opens, specify the destination directory and click OK.

How do I move a SVN project from one repo to another?

If you don't want history, you can use svn export to get a clean folder without the . svn folders and then svn import into your other repository. With history, you would need to use the svnadmin dump . You would then use svndumpfilter to filter for only the parts or paths you want to use before using svnadmin load .

What is SVN repository URL?

The repository URL will be: https://svn.cs.dal.ca/<student> where <student> is the student's CS user name. 2. Students create the SVN path in their repositories where coursework will be stored. The path for this course is https://svn.cs.dal.ca/<student>/csci3151. Student will be "eem" in the following examples.


2 Answers

You need to use a http URL to your subversion repository, or better yet bring the whole thing local with svnsync and use a file URL. Here are some more details:

https://www.mercurial-scm.org/wiki/ConvertExtension#More_about_Subversion_URL_and_Paths_Handling

like image 150
Ry4an Brase Avatar answered Nov 21 '22 19:11

Ry4an Brase


Using the convert extension of Mercurial:

  1. Enable convert extention; add convert= to the [extensions] section of .hgrc like this:

    [extensions]
    convert=

  2. Linux needs additional python bindings: sudo apt-get install python-subversion
  3. Execute hg convert command
    • See hg convert -h for help
    • Example: hg convert http://[svnserver]/[Project] --source-type svn [DestinationDir] (see note 2)
  4. Push to newly created Mercurial repository: hg push https://[mercurialserver]/[Project]

note: you can even repeat the hg convert command to include new changes made in the svn repository after the previous convert.

note 2: When hg convert doesn't work using http:// or svn:// you could first checkout the Subversion repository (or update an existing one) and convert using the local checkout; example: hg convert [DirectoryOfLocalCheckout] --source-type svn [DestinationDir]

like image 30
R. Oosterholt Avatar answered Nov 21 '22 17:11

R. Oosterholt