Migrating a svn repository without trunk to git using reposurgeon

466 Views Asked by At

I'm trying to convert an old svn repository to git. After reading a couple of posts describing the disadvantages of using git-svn for this task, especially for repositories with a non-standard layout, I decided to give reposurgeon a go. After initially using the version from the Ubuntu package sources (4.3) I switched to the most recent one (4.14; built from sources) just in case.

Sadly I wasn't able to generate more than an empty git repository so far. It seems I haven't been able to figure out how to properly use reposurgeon.

Here's the basic structure of the svn repository I am trying to convert:

  • branches
    • 1.0.x
    • 1.1.x
  • tags
    • development
      • 1.0.0
      • 1.0.1
      • 1.0.2
      • 1.1.0
    • production
      • 1.0.0
      • 1.0.1

There is more inside the repository, but that's the gist of it. The important thing to note here is

  1. No trunk
  2. The tag structure is not flat

Right now I'm trying to get a minimal number of steps running. I'm using http://www.catb.org/~esr/reposurgeon/repository-editing.html#quickstart as a guideline, so after creating an author map for the repository, i did the following:

repotool mirror URL project-mirror
reposurgeon
  read project-mirror
  authors read <project-mirror.map
  prefer git
  rebuild project-git

When I run read project-mirror inside reposurgeon (project-mirror being the directory of the mirror I created using repotool) I get the following output:

reposurgeon: nonexistent source "test" on pathmap copy
reposurgeon: component "test" to be deleted is missing
reposurgeon: 1898910: missing required date field
* project-mirror
reposurgeon: 2 new log message(s)

Creating a SVN dump first (either using repotool export or svnadmin dump on my local mirror) and reading that instead leads to the same result.

Running rebuild project-git yields the following result:

reposurgeon: not trying to checkout an empty repository
reposurgeon: rebuild is complete.
reposurgeon: preserved files restored.

This creates an empty git repository: no commits, no branches, no tags. I dont't expect the command chain I posted above to lead to exactly the result I want (after all it is even mentioned in the documentation that getting there is an iterative process), but I would have expected to at least have some commits and/or branches inside the git repository.

Any pointers in the right direction would be appreciated.

PS: It might also be important to note that the SVN Server can and must not be altered in any way during this process. I only have read access to the repository in question. I do not have any form of administrative access to this SVN server.

1

There are 1 best solutions below

0
On

Converting your repository should not represent a problem. Here's some things worth checking:

  1. Specify the source type; use sourcetype svn for that.
  2. Specify the nested tag structure via branchify branches/* tags/development/* tags/production/*

You might also want to flatten the tag names, e.g. with

branchmap :tags/development/(.+):tags/dev_\1: \
          :tags/production/(.+):tags/prod_\1: