Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Correct configuration for this case is the following:

No Format
[svn]
	url = http://example.com/svn/repository


	trunk#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:

No Format
nopaneltrue
/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:

There are two possible configurations for this case.

In the first, the URL is set leading to the project root and all the mapping options are disabled:

No Format
[svn]
	url = http://example.com/svn/repository/project_1

...

and comment the mapping settings:



	#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:

Note that this configuration doesn't allow to add branches and tags later.

Another possible configuration for this case is that the URL leads to the repository and trunk option is set to point to project directory:

No Format
[svn]
	url = 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 In this 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.:

...

configuration later just by enabling appropriate line in the configuration.


This single directory layout approach can also be applied in a case when only one branch from a repository should be translated. 

For example, a Subversion repository can stick to standard layout:

No Format
nopaneltrue
/svn
	/repository
		/project
			/trunk
			/branches
				/branch_1
				…            

...


			/tags
				…            

...

but if only branch_1 needs to be translated - it can be done as simply as

However, if branch_1 only is intended for the translation, then it can be done by the single directory layout approach using the configuration below:

No Format
[svn]
	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 Another way to express the same configuration is to set svn.url to point  leading directly to the branch_1 directory:

No Format
[svn]
	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 branchThe difference between these two configurations is that branches or tags can be added later to the first configuration, whereas nothing can be added to the second.