We are planning to migrate hydra svn repository to Bitbucket and the svn repository does not have standard folder structure with the branches, tags, trunk, etc.
We cannot relate the existing folders in svn repository to branches, trunk, etc to migrate to the relevant folders on Git or Bitbucket.
Can you help us how to take this forward?
it’s not mandatory to have this standard SVN directories structure, almost any layout can be translated to Git, the crucial thing is to provide SVN Mirror add-on with a correct mapping configuration. SVN Mirror add-on provides a possibility to scan the history and detect (that is the Automatic Configuration setting in the Subversion Project Layout section), but it requires a trunk directory to be selected – it’s actually not a directory with the name trunk, it can has any name, the idea is that it should be a directory representing a “main line of development”. Once it’s selected, the add-on will scan the repository history and create a mapping configuration.
If the automatically created configuration does not reflect the repository structure well enough, then the mapping can be edited manually. Here is a guide that describes how the mapping can be set:
Thank you for the suggestion and we started the import with “dev” folder as the trunk.
However the import fails with the following.
Command Failed : Hydra / hydra_f
The following layout options conflict (intersect) in configuration file '/xxxx/shared/data/subgit/repositories/1483/subgit':
svn.tags = tags/*:refs/tags/*
svn.branches = */_:refs/heads/*.
Please specify non-conflicting options and try again.
The Branches Mapping section is provided with the following inputs.
Branches mapping:
#
# Subversion to Git mapping options
#
[svn]
# Options below (trunk, branches, tags, shelves) define correspondence between Subversion
# directories and Git references. Depending on the actual Subversion project layout and whether
# all or only some of the branches have to be mirrored, these options might need to be adjusted.
#
# Generic mapping syntax is:
# <Subversion-Path-Pattern>:<Git-Reference-Pattern>
#
# Subversion paths are relative to the URL defined by the svn.url option.
#
# For more details refer to http://subgit.com/documentation pages.
trunk = dev:refs/heads/master
branches = */_:refs/heads/*
branches = hydra/dev:refs/heads/hydra/dev
tags = tags/*:refs/tags/*
shelves = shelves/*:refs/shelves/*
triggerGitGC = false
the matter is that the second one that starts with asterisk * covers all the directories at the first level of directories hierarchy thus including the tags directory – and that’s the intersection.
To resolve that issue this intersection must be eliminated. As of my understanding, that second line is not correct since this mapping literally means “all the second-level directories with the name ‘_’ that reside in any directory in the repository” – is that the mapping you intended to express? If not, then this line should be replaced with another mapping that would reflect the mapping more precisely, probably, with a direct (non-wildcarded) mapping.
Note, that since there’s no tags directory, no tags will be imported from SVN; but if a mirror is established and a tag is created in Git, it will be sent to SVN and appear in that directory.