Re: Problem with excluding tags/branches from import
Michael Haggerty <[email protected]> Sun, 07 Sep 2014 06:21:34 +0200
| Newsgroups | gmane.comp.version-control.subversion.cvs2svn.user |
|---|---|
| Message-ID | <[email protected]> |
On 07/06/2014 07:46 PM, Diomidis Spinellis wrote:
> I'm trying to import a large project with many symbols assigned to=20
> multiple revisions, as is the case in the following example.
>=20
> head 1.2;
> access;
> symbols
> V_0_1_2_4:1.1.1.1
> V_0_1_2_4:1.1.1;
> locks; strict;
>=20
> The import fails with errors pointing to duplicate symbols. I was=20
> hoping to get around this by whitelisting a few reasonable tags/branches=
=20
> and excluding the rest. However, even a simple command to exclude=20
> everything, like the following, apparently fails to exclude any revisions=
.
>=20
> cvs2svn-2.4.0/cvs2git --exclude=3D'.*' --blobfile=3D/dev/null=20
> --dumpfile=3D/dev/null --username=3Ddds x
> ----- pass 1 (CollectRevsPass) -----
> Examining all CVS ',v' files...
> x/Makefile,v
> ERROR: Multiple definitions of the symbol 'V_0_1_2_4' in 'x/Makefile,v':=
=20
> 1.1.1.1 1.1.1
> Pass 1 complete.
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
> Error summary:
> ERROR: Multiple definitions of the symbol 'V_0_1_2_4' in 'x/Makefile,v':=
=20
> 1.1.1.1 1.1.1
> Exited due to fatal error(s).
>=20
> I've tried the same approach by setting the ExcludeRegexpStrategyRule in=
=20
> the options file, both with a specific revision name, and a .* regular=20
> expression, again without any effect.
Maybe --exclude should have the effect you expected, but it doesn't. By
the time --exclude is processed (in FilterSymbolsPass), it is already
too late.
Instead, you need to use a "symbol transform" to fix up your problem in
CollectRevisionsPass (which in turn requires that you start the
transformation using an options file). If you want to exclude symbol
"V_0_1_2_4" entirely, you can use
IgnoreSymbolTransform(r'V_0_1_2_4')
If you want to ignore the branch version but keep the tag version, you
can use
BranchOnlyTransform(IgnoreSymbolTransform(r'V_0_1_2_4'))
The inner argument is treated as a regular expression, so if you have a
bunch of these symbols that all need the same treatment, you can do
something like
BranchOnlyTransform(IgnoreSymbolTransform(r'V_\d+_\d+_\d+_\d+'))
There is also a TagOnlyTransform, which applies the wrapped transform
only to tags.
For more complicated logic, you can derive your own class from
SymbolTransform that does whatever you want.
While you are at it, you might also be interested in renaming the tags
in a more user-friendly format using something like
RegexpSymbolTransform(r'V_(\d+)_(\d+)_(\d+)_(\d+)'),
r'V-\1.\2.\3.\4')
Please note that the example cvs2git-example.options does not import all
of these classes. You might have to add some lines like
from cvs2svn_lib.symbol_transform import BranchOnlyTransform
from cvs2svn_lib.symbol_transform import TagOnlyTransform
to the top of the file.
Hope that helps!
Michael
--=20
Michael Haggerty
[email protected]
------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=3D1670&dsMessageId=3D=
3088041
To unsubscribe from this discussion, e-mail: [[email protected]=
ris.org].