converting svn repo to git using reposurgeon

2020-08-20 11:10发布

I am trying to convert an svn repo to git using reposurgeon.

Here is what I did ( have a repo.map file that has the svn name -> git name mapping):

svnadmin dump /home/subversion > repo.svn
reposurgeon "verbose 1" "repo.svn" "authors read" "write repo.fi"

reposurgeon runs for many hours (lots of swapping as it is a 12GB dump file), and everything looks good. Here is the output I get:

    reposurgeon: verbose 1
    reposurgeon: from repo.svn...copynodes+filemaps+copysets+commits+branches+parents+root+branchlinks+svn-mergeinfo+tagifying+tagify-empty+polishing+canonicalizing+resets+debubbling+renumbering+14163 revisions (1/s)...(9810.18 sec) done.
reposurgeon: r13: deleting parentless zero-op commit.
.
.
.
reposurgeon: r13726: deleting parentless zero-op commit.
    2012-12-24T01:16:23Z * repo.svn

At this point reposurgeon just sits. I'm not sure where to look for a solution at this point, as it never actually gives me an error message. Any suggestions are most welcome.

标签: git svn svnadmin
2条回答
\"骚年 ilove
2楼-- · 2020-08-20 11:46

If you would consider an alternative to reposurgeon and git-svn, have a look at SubGit.

$ subgit configure /home/subversion
#edit /home/subversion/conf/subgit.conf to set 'core.authorsFile' option to path to "repo.map" file
$ subgit install /home/subversion
$ subgit uninstall --purge /home/subversion

The converted repository will be in /home/subversion/.git directory. As a bonus, you'll have all svn:ignore and svn:eol-style properties converted to their Git analog.

Usually SVN repository is about 4x more compact than a corresponding dump file, so the conversion of the original repository can be faster than dump-based conversion.

查看更多
Lonely孤独者°
3楼-- · 2020-08-20 11:52

It's successfully imported the repository, but then it goes to process the authors read command, but you didn't specify a file. At this point it's actually waiting for the file to appear on stdin. Use authors read <author-map where author-map is the name of the file containing the map.

You'll also want to change the write command to write >repo.fi, for similar reasons.

查看更多
登录 后发表回答