7

I'm trying to convert a Subversion repository to Git using reposurgeon, the repository holds several projects with the following layout:

<groupname>/<projectname>/{trunk,tags,branches}

I tried this reposurgeon script:

read <svnrepository.dump
sourcetype svn
prefer git
rebuild myrepository

But the result was a Git repository with a branch per group.

Is there a way to restrict the conversion to a single project?

ofirule
  • 4,233
  • 2
  • 26
  • 40
Emmanuel Bourg
  • 9,601
  • 3
  • 48
  • 76

1 Answers1

5

Use the --include option of svnadmin dump to restrict the dump to one project, then repocutter to strip away the path prefix.

svnadmin dump . --include '/<groupname>/<projectname>' | 
    repocutter pathrename '^<groupname>/<projectname>/' '' > svnrepository.dump

Then use reposurgeon as before.

user3840170
  • 26,597
  • 4
  • 30
  • 62
  • Thank you for the suggestion, unfortunately it didn't work well. `reposurgeon` fails to process the filtered dump, either with a KeyError or a "missing required date field at line". – Emmanuel Bourg May 04 '20 at 14:30
  • Looks like a bug in reposurgeon… wouldn’t be the first. I tried it on one of my own dumped SVN repositories with a similar structure and it did work. – user3840170 May 04 '20 at 16:23