Page tree

Versions Compared

Key

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

...

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

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

	#trunk = :refs/heads/master
    #branches = branches/*:refs/heads/*
    #tags = tags/*:refs/tags/*
    #shelves = shelves/*:refs/shelves/*

...

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
[SVNsvn]
	url = http://example.com/svn/repository

	trunk = project_1:refs/heads/master
    #branches = branches/*:refs/heads/*
    #tags = tags/*:refs/tags/*
    #shelves = shelves/*:refs/shelves/*

In this branches and tags can be added to configuration later just by enabling appropriate line in the configuration.

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

...


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.