Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty repository after subversion -> mercurial conversion

Tags:

svn

mercurial

I've used the 'hg convert' command to try to move my SVN repository to hg, and it seems to work (takes a while and prints out all the commit messages as it goes), but at the end the resulting Mercurial directory is empty. It has the .hg hidden subdirectory in it, and it's about 200 MB so SOMETHING happened, but none of the files are there.

Any thoughts?

The only thing I can think of as being involved is that instead of having top-level trunk, brankes, tags directories, we have many projects, each with their own trunk, branches, tags:


svn-repository/  
    Project1/  
        trunk/  
        branches/  
        tags/  
    Project2/  
        trunk/  
        branches/  
        tags/  

etc...

Could that be causing the problem? My understanding is that SVN doesn't really care how you organize the repository, but does Mercurial?

like image 216
Hank Avatar asked Oct 15 '09 19:10

Hank


1 Answers

You need to run hg update to get a working copy.

(Such mercurial repositories without a working copy can be used as pure communication points where revisions are pushed to or pulled from, much like a subversion server. In this case it was created by hg convert, but you can also create such repositories with hg clone --noupdate or hg update null. Omitting the working copy files saves some space.)

Also, I would recommend you convert each project separately. If you give the URL for "project1", hg convert will automatically detect the trunk, branches and tags subfolders and will do the right thing.

In mercurial, branches are first-class concepts rather than just folders who happen to have been svn-copied from the trunk. The branches don't live in any user-visible location like in svn. Having multiple projects (each with their own branches) in a single mercurial repository doesn't really make sense.

like image 112
Wim Coenen Avatar answered Nov 10 '22 16:11

Wim Coenen