You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Erick Calder <e...@arix.com> on 2009/08/12 02:25:33 UTC

changing repo layouts

I used cvs2svn to convert my repository and the tool wrote branch,  
tags and trunk at the top... I'd rather list the projects at the top.   
is there a way to convert this without having to do it by hand one  
directory at a time?

- e

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2382754

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

cross compile error

Posted by Payne Chu <pa...@yahoo.com>.
Dear Sir,

When I try to cross compile the subversion. I got below error.
How can I fix it ?~

In file included from ./include/apr_strings.h:52,
                 from passwd/apr_getpass.c:23:
../include/apr_want.h:93: error: redefinition of 'struct iovec'
make[1]: *** [passwd/apr_getpass.lo] Error 1
make: *** [all-recursive] Error 1

Regards,
Payne

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2386430

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: changing repo layouts

Posted by Erick Calder <e...@arix.com>.
On Aug 15, 2009, at 10:18 PM, David Weintraub wrote:

> On Sat, Aug 15, 2009 at 1:54 AM, Erick Calder <e...@arix.com> wrote:
> the structure I want is: /project/trunk, /project/tags, /project/
> branches.  I found the --trunk, --branches and --tags options
> available to cvs2svn but from the documentation I could not hope to
> figure out how to use these to build what I want...
>
> Okay, we converted one project at a time, so the --branches and -- 
> tags options allowed us to specify the location in the repository  
> where we wanted the branches and tags. I am not a Python developer,  
> so I didn't bother with the options file. However, I did find this  
> piece of information which you might find very handy:
>
> <http://cvs2svn.tigris.org/faq.html#onetoone>
>
> Or you do what I did: Write a shell script to convert one project at  
> a time, and specify where the trunk, tags, and branches for that  
> project would be using the --trunk, --tags, and --branches command  
> line options:
>
> for cvs_module in $CVSROOT/modules/*
> do
>     cvs2svn -s $cvs_module-svn --trunk /modules/$cvs_module/trunk -- 
> branches /modules/$cvs_module/branches --tags /modules/$cvs-module/ 
> tags
> done

I've struggled to make this work, and have ended up writing a little  
tool to flip the hierarchy left by your code above (see comments  
below)... so I'm wondering how I could get the mini-HOWTO below into  
somewhere that makes sense:

Assuming that the CVS repository to convert lies at $CVSROOT, we first  
convert the entire store, project by project, placing it in a  
temporary area:

# rm -rf /tmp/cvs-svn
# mkdir -p /tmp/cvs-svn
# for d in $CVSROOT/*
	do
	m=${d##*/}
	cvs2svn --encoding=ascii --encoding=iso8859_10 \
		--svnrepos=/tmp/cvs-svn/$m \
		--trunk=$m/trunk \
		--branches=$m/branches \
		--tags=$m/tags \
		$d
	done
# rm -rf /tmp/cvs-svn/CVSROOT

notice that cvs2svn takes relative paths for the --branches, --trunk  
and --tags.  this is implied in the syntax description (via the  
default value used) but it would be better explicitly stated.

also, the --encoding is useful when you have non-ascii characters in  
the names of your files (in the repository).  chose a suitable  
encoding as needed.

now create a fresh Subversion repository (and don't forget to create  
an account that you can use to move stuff around):

# svnadmin create /var/svn

and import all the projects from the temporary place:

# for p in /tmp/cvs-svn/*; do svnadmin dump $p |svnadmin load /var/ 
svn; done

at this point we're almost there.  nested projects will not be  
properly laid out. For example, code for a perl module like  
POE::Component::FS::Detect will exhibit the following structure:

/POE/trunk/Component/FS/Detect
/POE/tags/start/Component/FS/Detect
/POE/branches/whatever/Component/FS/Detect

when what we'd really like is (since /POE, /POE/Component and /POE/ 
Component/FS are just placeholders (empty directories) and will never  
have branches/tags of their own):

/POE/Component/FS/Detect/trunk
/POE/Component/FS/Detect/tags
/POE/Component/FS/Detect/branches

we can fix that by calling the attached script like this (replacing  
<user> and <pass> with the account created when the repo was created):

# svnrepo-layout-flip <user>/<pass> prune

the second parameter is optional and will remove empty directories like:

/POE/branches
/POE/tags

which we don't need.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2386421

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: changing repo layouts

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Aug 19, 2009, at 01:46, Erick Calder wrote:

> On Aug 15, 2009, at 10:18 PM, David Weintraub wrote:
>
>> Then use svnadmin dump and load to create a single Subversion  
>> repository. The Subversion repository revisions will come out  
>> somewhat wacky because all of module "A"'s transaction will come  
>> after module "B"s transactions, but it really doesn't affect  
>> anything in the long run.
>
> I'm a little queasy about that approach just because, not really  
> knowing SVN, I don't know why I'd care about A's transactions being  
> after B's.

A reason you might care is that you will not be able to use the  
Subversion feature that would otherwise let you specify a date  
anyplace you can specify a revision, e.g.

svn cat somefile.txt -r '{2009-08-15}'


> I guess I'm not even sure what you mean by transactions.

Transactions are what revisions are called before they're finalized.


> so I decided to just let the utility create its structure and then  
> move the directories as I see fit... however, when I try it I get  
> an error:
>
> # svn mv svn://janus/trunk/www /www/trunk
> svn: No support for repos <--> working copy moves

That error message looks correct. You probably meant:

# svn mv svn://janus/trunk/www svn://janus/www/trunk

Probably still won't work like that. I imagine you'll have to check  
out svn://janus and then use svn mkdir and svn mv and then commit the  
whole thing.


> and additionally, in reviewing the structure it created, I'm a  
> little confused because under CVS there aren't branches and tags...  
> so I'm not sure where to create these directories e.g. if I have a  
> project /Text/Roman, should I have /Text/trunk, /Text/Roman/trunk?  
> and what if there's /Text/Roman/Test (which isn't really a project  
> but a directory under a project) - then in that case shall I  
> create /Text/Roman/Test/trunk too?
>
> yikes!
>
> and then there is the /tags directory that seems to contain /tag/ 
> directory where the directory seems to be a project... can I safely  
> assume it's a project?  in that case could I have situations where  
> there are two projects under the same tag?
>
> and still under /branches I find all my projects but there is a  
> directory "arix" in the middle...
>
> I really do wish cvs2svn did the right thing to avoid all this  
> confusion!

If you have a single repository containing multiple projects, you  
must decide what unit you would like to be able to tag and branch. If  
you would like to be able to tag and branch each project separately,  
then the layout you want is

repo/project1/trunk/...
repo/project1/branches/branch1/...
repo/project1/branches/branch2/...
repo/project1/tags/tag1/...
repo/project1/tags/tag2/...
repo/project2/trunk/...
repo/project2/branches/branch1/...
repo/project2/branches/branch2/...
repo/project2/tags/tag1/...
repo/project2/tags/tag2/...

If the projects are all closely related and you want to tag and  
branch them together as a single unit, then the layout you want is

repo/trunk/project1/...
repo/trunk/project2/...
repo/branches/branch1/project1/...
repo/branches/branch1/project2/...
repo/branches/branch2/project1/...
repo/branches/branch2/project2/...
repo/tags/branch1/project1/...
repo/tags/branch1/project2/...
repo/tags/branch2/project1/...
repo/tags/branch2/project2/...

You won't create these branch1/branch2/tag1/tag2 directories now, I'm  
just showing you where the branch and tag names would appear in the  
directory structure once you do start creating tags and branches  
(which you simply do by copying the trunk to the correct place).

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2385124

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: changing repo layouts

Posted by Erick Calder <e...@arix.com>.
On Aug 15, 2009, at 10:18 PM, David Weintraub wrote:

> On Sat, Aug 15, 2009 at 1:54 AM, Erick Calder <e...@arix.com> wrote:
> the structure I want is: /project/trunk, /project/tags, /project/
> branches.  I found the --trunk, --branches and --tags options
> available to cvs2svn but from the documentation I could not hope to
> figure out how to use these to build what I want...
>
> Okay, we converted one project at a time, so the --branches and -- 
> tags options allowed us to specify the location in the repository  
> where we wanted the branches and tags. I am not a Python developer,  
> so I didn't bother with the options file. However, I did find this  
> piece of information which you might find very handy:
>
> <http://cvs2svn.tigris.org/faq.html#onetoone>
>
> Or you do what I did: Write a shell script to convert one project at  
> a time, and specify where the trunk, tags, and branches for that  
> project would be using the --trunk, --tags, and --branches command  
> line options:
>
> for cvs_module in $CVSROOT/modules/*
> do
>     cvs2svn -s $cvs_module-svn --trunk /modules/$cvs_module/trunk -- 
> branches /modules/$cvs_module/branches --tags /modules/$cvs-module/ 
> tags
> done
>
> Then use svnadmin dump and load to create a single Subversion  
> repository. The Subversion repository revisions will come out  
> somewhat wacky because all of module "A"'s transaction will come  
> after module "B"s transactions, but it really doesn't affect  
> anything in the long run.
>

I'm a little queasy about that approach just because, not really  
knowing SVN, I don't know why I'd care about A's transactions being  
after B's.  I guess I'm not even sure what you mean by transactions.   
so I decided to just let the utility create its structure and then  
move the directories as I see fit... however, when I try it I get an  
error:

# svn mv svn://janus/trunk/www /www/trunk
svn: No support for repos <--> working copy moves

and additionally, in reviewing the structure it created, I'm a little  
confused because under CVS there aren't branches and tags... so I'm  
not sure where to create these directories e.g. if I have a project / 
Text/Roman, should I have /Text/trunk, /Text/Roman/trunk? and what if  
there's /Text/Roman/Test (which isn't really a project but a directory  
under a project) - then in that case shall I create /Text/Roman/Test/ 
trunk too?

yikes!

and then there is the /tags directory that seems to contain /tag/ 
directory where the directory seems to be a project... can I safely  
assume it's a project?  in that case could I have situations where  
there are two projects under the same tag?

and still under /branches I find all my projects but there is a  
directory "arix" in the middle...

I really do wish cvs2svn did the right thing to avoid all this  
confusion!

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2385104

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: changing repo layouts

Posted by Erick Calder <e...@arix.com>.
On Aug 15, 2009, at 10:18 PM, David Weintraub wrote:

> On Sat, Aug 15, 2009 at 1:54 AM, Erick Calder <e...@arix.com> wrote:
> the structure I want is: /project/trunk, /project/tags, /project/
> branches.  I found the --trunk, --branches and --tags options
> available to cvs2svn but from the documentation I could not hope to
> figure out how to use these to build what I want...
>
> Okay, we converted one project at a time, so the --branches and -- 
> tags options allowed us to specify the location in the repository  
> where we wanted the branches and tags. I am not a Python developer,  
> so I didn't bother with the options file. However, I did find this  
> piece of information which you might find very handy:
>
> <http://cvs2svn.tigris.org/faq.html#onetoone>

I decided to give the config-file thing a try but it breaks.  here's  
my config file:

ctx.output_option = NewRepositoryOutputOption(
     r'/var/svn'
     )
ctx.cvs_filename_decoder = CVSTextDecoder(
     [ 'iso8859_10' ],
     fallback_encoding='ascii'
     )
run_options.add_project(
     '/var/dump/cvs/www',
     trunk_path='www/trunk',
     branches_path='www/branches',
     tags_path='www/tags',
     )

and when I run the command I get the following:

# /tmp/cvs2svn-2.2.0/cvs2svn --options=/tmp/cvs2svn /var/dump/cvs
/tmp/cvs2svn-2.2.0/cvs2svn_lib/dumpfile_delegate.py:20:  
DeprecationWarning: the md5 module is deprecated; use hashlib instead
   import md5
/tmp/cvs2svn-2.2.0/cvs2svn_lib/metadata_database.py:20:  
DeprecationWarning: the sha module is deprecated; use the hashlib  
module instead
   import sha
Traceback (most recent call last):
   File "/tmp/cvs2svn-2.2.0/cvs2svn", line 31, in <module>
     main(sys.argv[0], sys.argv[1:])
   File "/tmp/cvs2svn-2.2.0/cvs2svn_lib/main.py", line 46, in main
     run_options = RunOptions(progname, cmd_args, pass_manager)
   File "/tmp/cvs2svn-2.2.0/cvs2svn_lib/run_options.py", line 268, in  
__init__
     self.process_options_file(value)
   File "/tmp/cvs2svn-2.2.0/cvs2svn_lib/run_options.py", line 774, in  
process_options_file
     execfile(options_filename, g, l)
   File "/tmp/cvs2svn", line 1, in <module>
     ctx.output_option = NewRepositoryOutputOption(
NameError: name 'NewRepositoryOutputOption' is not defined

I've googled but find no easily understandable solution.

- e

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2385127

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: changing repo layouts

Posted by David Weintraub <qa...@gmail.com>.
On Sat, Aug 15, 2009 at 1:54 AM, Erick Calder <e...@arix.com> wrote:

> the structure I want is: /project/trunk, /project/tags, /project/
> branches.  I found the --trunk, --branches and --tags options
> available to cvs2svn but from the documentation I could not hope to
> figure out how to use these to build what I want...


Okay, we converted one project at a time, so the --branches and --tags
options allowed us to specify the location in the repository where we wanted
the branches and tags. I am not a Python developer, so I didn't bother with
the options file. However, I did find this piece of information which you
might find very handy:

<http://cvs2svn.tigris.org/faq.html#onetoone>

Or you do what I did: Write a shell script to convert one project at a time,
and specify where the trunk, tags, and branches for that project would be
using the --trunk, --tags, and --branches command line options:

for cvs_module in $CVSROOT/modules/*
do
    cvs2svn -s $cvs_module-svn --trunk /modules/$cvs_module/trunk --branches
/modules/$cvs_module/branches --tags /modules/$cvs-module/tags
done

Then use svnadmin dump and load to create a single Subversion repository.
The Subversion repository revisions will come out somewhat wacky because all
of module "A"'s transaction will come after module "B"s transactions, but it
really doesn't affect anything in the long run.

also, the man page for svnsync is rather useless, as is svnsync
> help... there isn't even really a synopsis of what this command is
> supposed to do.  could you elucidate how I can use it for my purposes?
>

svnsync isn't for the conversion. It allows you to synchronize one
Subversion repository to another Subversion server instance. This second
Subversion server is a read-only instance, and can be used in remote
locations which might experience slow connections to the root repository.
Some people use it for mirroring in case the first Subversion server becomes
inaccessible. You could then use this second Subversion repository as a the
backup.

By the way, I agree the documentation is pretty bad for both svnsync and
cvs2svn. Fortunately, you only have to use cvs2svn once, and svnsync is
fairly easy to setup once you understand what it does.

-- 
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2383986

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: changing repo layouts

Posted by Erick Calder <e...@arix.com>.
On Aug 12, 2009, at 5:00 AM, Nico Kadel-Garcia wrote:

> On Tue, Aug 11, 2009 at 10:25 PM, Erick Calder<e...@arix.com> wrote:
>> I used cvs2svn to convert my repository and the tool wrote branch,
>> tags and trunk at the top... I'd rather list the projects at the top.
>> is there a way to convert this without having to do it by hand one
>> directory at a time?
>>
>> - e
>
> It depends on the structure you want. For most projects, it's safer to
> split up multiple projects into multiple repositories. But now that
> you have cvs2svn working, you can follow this step with 'svnsync' or
> other tools to build the structure you wish.

the structure I want is: /project/trunk, /project/tags, /project/ 
branches.  I found the --trunk, --branches and --tags options  
available to cvs2svn but from the documentation I could not hope to  
figure out how to use these to build what I want...

also, the man page for svnsync is rather useless, as is svnsync  
help... there isn't even really a synopsis of what this command is  
supposed to do.  could you elucidate how I can use it for my purposes?

thx in advance - e

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2383821

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: changing repo layouts

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Tue, Aug 11, 2009 at 10:25 PM, Erick Calder<e...@arix.com> wrote:
> I used cvs2svn to convert my repository and the tool wrote branch,
> tags and trunk at the top... I'd rather list the projects at the top.
> is there a way to convert this without having to do it by hand one
> directory at a time?
>
> - e

It depends on the structure you want. For most projects, it's safer to
split up multiple projects into multiple repositories. But now that
you have cvs2svn working, you can follow this step with 'svnsync' or
other tools to build the structure you wish.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2382867

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: changing repo layouts

Posted by David Weintraub <qa...@gmail.com>.
Check out the cvs2svn help. There's a command line parameter that allows you
to specify where branch and tags should go. You can also specify what
branches and tags you do want to move over too.

Unfortunately, I don't remember it off hand, but that's what I used. Do a
cvs2svn --help (or something like that). It'll list all of its command line
parameters. That's how I found it.

BTW, don't use the command line parameter that adds a cvs2svn:cvs-rev
property on your files. It's tempting to use, but it causes loads of trouble
later on because that property sticks with your files forever. If you do use
it, you have to checkout your entire repository, remove it, and then commit
everything back. Big, big mess.

On Tue, Aug 11, 2009 at 10:25 PM, Erick Calder <e...@arix.com> wrote:

> I used cvs2svn to convert my repository and the tool wrote branch,
> tags and trunk at the top... I'd rather list the projects at the top.
> is there a way to convert this without having to do it by hand one
> directory at a time?
>
> - e
>
> ------------------------------------------------------
>
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2382754
>
> To unsubscribe from this discussion, e-mail: [
> users-unsubscribe@subversion.tigris.org].
>



-- 
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2383361

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].