[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Commits files to subversion from 2 different directories

From: Ryan Schmidt <subversion-2007a_at_ryandesign.com>
Date: 2007-01-14 23:09:19 CET

On Jan 14, 2007, at 16:01, ken carlino wrote:

> On 1/14/07, Ryan Schmidt wrote:
>
>> On Jan 14, 2007, at 10:27, ying lcs wrote:
>>
>> > i have 2 directories of source code:
>> > 1. org-source
>> > 2. modified-source (org-source + modified source code, don't
>> exactly
>> > remember which files have changed).
>> >
>> > and i want to use subversion to do version control. Here is what I
>> > did:
>> > 1. create a new repository 'source' in subversion
>> > 2. cd to org-source and
>> > svn import . file:///srv/svn/repositories/source --message
>> > "Initial import"
>> >
>> > Then, I want to
>> > 3: tag all the files in the source with a label called 'VERSION1"
>>
>> Subversion does not do branching and tagging the way CVS does. You do
>> not "tag files with a label". Instead, you simply make a copy of your
>> files elsewhere, usually to a directory named "tags". The book
>> explains this more.
>>
>> http://svnbook.red-bean.com/en/1.2/svn.branchmerge.tags.html
>>
>> There's even an appendix for users coming to Subversion from CVS.
>>
>> http://svnbook.red-bean.com/en/1.2/svn.forcvs.html
>>
>> > 4: commit all files in the directory 'modified-source' to
>> subversion
>> > so that subversion can figure out what files are different. And it
>> > will create a new version if the files is different and add the
>> files
>> > to the repository if it is a new file.
>>
>> You may want to use the svn_load_dirs.pl script which is included in
>> the Subversion source and is designed for this kind of scenario. It's
>> described in the vendor branching section of the book:
>>
>> http://svnbook.red-bean.com/en/1.2/svn.advanced.vendorbr.html
>>
>> In particular here:
>>
>> http://svnbook.red-bean.com/en/1.2/
>> svn.advanced.vendorbr.html#svn.advanced.vendorbr.svn_load_dirs
>>
>> > 5. tag all the files in trunk with a label called VERSION2"
>>
>> svn_load_dirs.pl can automatically create a tag of your newly-
>> imported version.
>>
>> > Can you please tell me if step 3 and 4 are possible?
>>
>> So putting this all together:
>>
>> > 1. create a new repository 'source' in subversion
>>
>> svnadmin create /srv/svn/repositories/source
>>
>> > 2. cd to org-source and
>> > svn import . file:///srv/svn/repositories/source --message
>> > "Initial import"
>>
>> For each new project, you should generally set up the recommended
>> "trunk" / "branches" / "tags" directory structure. The reasons are
>> explained in the book:
>>
>> http://svnbook.red-bean.com/en/1.2/svn.branchmerge.using.html
>>
>> So create these empty directories:
>>
>> svn mkdir file:///srv/svn/repositories/source/trunk \
>> -m "Making trunk dir"
>> svn mkdir file:///srv/svn/repositories/source/branches \
>> -m "Making branches dir"
>> svn mkdir file:///srv/svn/repositories/source/tags \
>> -m "Making tags dir"
>>
>> Then you can import the original source into the trunk.
>>
>> svn import /path/to/org-source \
>> file:///srv/svn/repositories/source/trunk \
>> -m "Initial import"
>>
>> > 3: tag all the files in the source with a label called 'VERSION1"
>>
>> Create the "VERSION1" tag by copying the trunk to a new name in the
>> tags directory:
>>
>> svn cp file:///srv/svn/repositories/source/trunk \
>> file:///srv/svn/repositories/source/tags/VERSION1 \
>> -m "Creating VERSION1 tag"
>>
>> > 4: commit all files in the directory 'modified-source' to
>> subversion
>> > so that subversion can figure out what files are different. And it
>> > will create a new version if the files is different and add the
>> files
>> > to the repository if it is a new file.
>> >
>> > 5. tag all the files in trunk with a label called VERSION2"
>>
>> Use svn_load_dirs.pl to load modified-source and tag it as VERSION2:
>>
>> svn_load_dirs.pl \
>> -t tags/VERSION2 \
>> file:///srv/svn/repositories/source \
>> trunk \
>> /path/to/modified-source
>
> Thanks. I am at the last step, But I get this questions:
> But why the script tag the directory as 'tags/VERSIONS2' ? instead of
> just 'VERSION2'?
>
> Should I type ' -t VERSION2' instead of ' -t tags/VERSION2'?
>
> Directory /path/to/modified-source/ will be tagged as tags/VERSION2
> Please examine identified tags. Are they acceptable? (Y/n)

You should type "-t tags/VERSION2" as stated.

The suggested layout for a vendor branch is different from the
suggested layout for a normal project that you develop yourself.
Since svn_load_dirs.pl is designed for the vendor branch directory
layout, not the normal project directory layout, you need to tell it
what directory to put the tag into, because if you don't, it will
create it at the same level as trunk.

Usual vendor branch directory layout:

/repo/vendor/
        current/
        tag1/
        tag2/

Normal project directory layout:

/repo/project/
        trunk/
        branches/
                branch1/
                branch2/
        tags
                tag1/
                tag2/

-- 
To reply to the mailing list, please use your mailer's Reply To All  
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Jan 14 23:09:52 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.