The single directory layout means there's only one single directory where everything resides. The simplest case is that where all the files and directories reside right in the repository root and there are no branches or tags:
/repository dir1 … dirN file1 … fileN |
Correct configuration for this case is the following:
[svn] http://example.com/svn/repository trunk = :refs/heads/master #branches = branches/*:refs/heads/* #tags = tags/*:refs/tags/* #shelves = shelves/*:refs/shelves/* |
Note, that in such case (repository root is used) it's impossible to add branches or tags later on.
Another kind of the single directory layout is an SVN repository hosting more than one project, each project lives in its own directory inside the repository and each projects' files are stored right in the project directory root:
/repository /project_1 dir1 … dirN file1 … fileN /project_2 … /project_N |
The same approach applies to the case when all the files reside in project's (not repository) root directory: that is, each project in repository has its own directory, but the project being translated has no branches and tags and all the files are situated right in project's root:
Similarly, we can just set svn.url
to point to project root:
http://example.com/svn/repository/project_1
and comment the mapping settings:
#trunk = trunk:refs/heads/master
#branches = branches/*:refs/heads/*
#tags = tags/*:refs/tags/*
#shelves = shelves/*:refs/shelves/*
or remove them at all.
Unlike the first case though, the mapping for this layout can be set in one more way: we can set the svn.url
to point the repository root directory:
http://example.com/svn/repository
and set project directory to be trunk
:
trunk = project_1:refs/heads/master
#branches = branches/*:refs/heads/*
#tags = tags/*:refs/tags/*
#shelves = shelves/*:refs/shelves/*
This approach will also translate the project to Git; but additionally, branches and tags can be created and added to translation later with almost no configuration effort since project's directory acts as a trunk.
One more common case is that only one particular branch has to be translated to Git. The repository and project can be arbitrary complex, e.g.:
/svn
/repository
/project
/trunk
/branches
/branch_1
…
/bugs
…
/features
…
/tags
…
/major_releases
/minor_releases
…
but if only branch_1 needs to be translated - it can be done as simply as
url = http://example.com/svn/repository/project/branches
trunk = branch_1:refs/heads/master
#branches = branches/*:refs/heads/*
#tags = tags/*:refs/tags/*
#shelves = shelves/*:refs/shelves/*
that is, we set svn.url
to point to the branches directory inside the project directory and set branch_1 to be trunk
.
Another way is to set svn.url
to point directly to the branch_1 directory:
url = http://example.com/svn/repository/project/branches/branch_1
and comment (or remove) all the rest options:
#trunk = trunk:refs/heads/master
#branches = branches/*:refs/heads/*
#tags = tags/*:refs/tags/*
#shelves = shelves/*:refs/shelves/*
Both ways are equivalent - the branch_1 will be translated into Git's master branch.