Adding branch mappings

Hello, we have a project currently configured like this:

url = http://devsvn:8080/svn/Repo/Trunk
trunk = :refs/heads/master

We would like to sync another branch, so would need this config:

url = http://devsvn:8080/svn/Repo
trunk = Trunk:refs/heads/master
branches = Branch1:refs/heads/branch1

When I run the install command for the above (v3.3.9) I get this error:

error: The following new mappings have been removed from [svn] section:
error:    :refs/heads/master
error: Only branches that are not yet present in Subversion history could be removed.
error: Revert these deletions and run 'install' command, or force rebuild with '--rebuild' option.

I also tried with the original url and trunk and adding a relative path to the branch starting with ../ but it didn’t like this either:

error: There is one layout option with empty SVN part:
error:
error:   :refs/heads/master
error:
error: In this case only trunk option is allowed, please remove layout options with non-empty SVN part:
error:
error:   ../Branch1:refs/heads/branch

Is the only way for me to add this branch to use the above config and run with rebuild? What happens to my existing master branch if I do this, does it get “trashed” (i.e. new commit SHAs and users have to re-clone)? What happens to existing merge requests if this is synced with a Gitlab project?

Thank you.

Hello Oliver,

thank you for reaching out to us on this matter!

The mapping configuration you used initially:

url = http://devsvn:8080/svn/Repo/Trunk
trunk = :refs/heads/master

is a special kind config only allows to use this single directory for translation and does not allow adding more branches or tags. To translate more than one branch it must be converted to the regular mapping configuration, the one you mentioned:

url = http://devsvn:8080/svn/Repo
trunk = Trunk:refs/heads/master
branches = Branch1:refs/heads/branch1

The matter is that, however, such a change cannot be applied on the fly and requires complete repository rebuild, and I’m afraid, that there is no way to avoid such a rebuild. The rebuild will actually reset the Git repository and will re-import the repository from the very beginning. Since adding a new branch to the configuration may change parents, then there is a change that SHAs in the newly imported repository will be different comparing to the current Git repository. The merge requests may also be absent as the rebuilt repository will only contain commits and branches that exist in the SVN repository.

Ok, thank you for confirming these points!