I am working on converting a CVS repository that has the following symbols (among others):
tcm-6.1.0-branch
-- a branch
tcm-6.1.0
-- a tag
Using the standard transformations cvs2svn identifies them properly. However, I'd like to do some clean up during the conversion. Specifically I'd like to drop the redundant '-branch' portion of the branch symbol, since it will be in the 'branches' dir in svn. I added the following to the symbol_transforms of the project:
RegexpSymbolTransform(r'(.*)-branch', r'\1')
Now I end up with " ERROR: Multiple definitions of the symbol 'tcm-6.1.0' in ..." for every file because tcm-6.1.0
is both a branch and a tag. I have several CVS symbol pairs that result in this problem.
It seems to me that since the source symbols are different and the destination directories are different this operation should be possible. Is there something I'm missing or is this simply a shortcoming of cvs2svn?
How can I rename these symbols such that they remain separate and result in a branch and a tag with the same name?
--
If there is no work around I will try to exclude the problem symbols from the conversion rules and move them by hand afterwards, though I'd rather do it at conversion time.
RegexpSymbolTransform
operates at too low a level, during the parsing of the repository files. Therefore, if you use a SymbolTransform
to give two symbols the same name, they will be treated as one and the same symbol.
It is possible to rename branches and tags after the conversion, but this would require an explicit SVN commit that will remain in your history forevermore, making history exploration a bit more complicated.
Instead, you should convert the branch with its original name, but then tell cvs2svn to store it to the SVN path /branches/tcm-6.1.0. That way the symbol will end up in the right place for an SVN branch with the desired name, but will still be treated by cvs2svn as distinct from the similarly-named tag.
This can be done using --symbol-hints=symbol-hints.txt
command-line option or the SymbolHintsFileRule('symbol-hints.txt')
symbol strategy rule, where symbol-hints.txt
is a file containing a line like the following:
. tcm-6.1.0-branch branch /branches/tcm-6.1.0 .
The only disadvantage of this approach that I can think of is that some commit messages that are autogenerated by cvs2svn
(for example, for the creation of the branch) will mention the original branch name.