[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-16 06:43:32 CET

On Jan 15, 2007, at 23:11, ying lcs wrote:

> On 1/15/07, Ryan Schmidt wrote:
>
>> > After following the last steps of your instruction " Use
>> > svn_load_dirs.pl to load modified-source and tag it as VERSION2:",
>> >
>> > should i execute 'svn update' to make my 'modified-source'
>> directory a
>> > 'working directory?
>>
>> "svn update" does not make an unversioned directory into a working
>> copy. It merely updates a working copy. And it cannot be done in a
>> directory that is not already a working copy.
>>
>> > Or should i execute 'svn checkout' to a new directory and make
>> that my
>> > 'working directory and removing my 'org-source' and 'modified-
>> source'
>> > directory.
>>
>> Correct, that is what you will need to do.
>>
>> > Right now, when i commit a file from my 'modified-source'
>> directory,
>> > it said 'svn: modified-source' is not a working copy.
>>
>> Right: modified-source is not a working copy, so you cannot "svn
>> commit" or "svn update" in it.

> Thanks. But what happens if I do this:
>
> * make some changes to modified-source directory (after i execute
> svn_load_dirs.pl once).

You should not make changes in that directory anymore. Now that it's
been imported into your repository, you should discard that directory
(well, make a backup somewhere, just in case) and instead check out a
working copy (using "svn checkout") and start making your changes in
there. Then you can commit those changes with "svn commit".

> * Use svn_load_dirs.pl to load modified-source and to re-tag it as
> VERSION2?

A tag in Subversion is generally supposed to be a read-only object.
Subversion does not enforce this, but that's the only difference
between the concept of a branch and the concept of a tag: if you want
to change it, then it's a branch, not a tag, and it might be better
to put it in the branches directory instead of the tags directory.

If you do want to simply re-tag the current trunk as VERSION2, then
you can "svn rm" VERSION2 and "svn cp" it again from trunk. If you're
using svn_load_dirs.pl, then you could "svn rm" VERSION2 first, then
svn_load_dirs.pl will recreate it. Note: if you fail to "svn rm"
first, and yet give it the same tag name which already exists, you
will not get the behavior you want; you will get this instead:

http://svn.haxx.se/users/archive-2006-11/0895.shtml

So be sure to "svn rm" VERSION2 first if your intention is to replace
that tag's contents.

> or
>
> * Use svn_load_dirs.pl to load modified-source and to re-tag it as
> VERSION3?

Yes, you can do that.

On Jan 15, 2007, at 23:26, ying lcs wrote:

> What I am trying to find out is after i did svn_load_dirs.pl once to
> my modified-source,
> and tag that as VERSION2, I find out that i miss some files.
>
> how can i import those missing files and tag them as VERSION2?
> Should I use the 'svn import' command? But how can I re-tag those new
> adding files as VERSION2?
>
> Or I put those new files in modified-source directory and reapply the
> 'svn_load_dirs.pl' script.
>
> What is a better solution?

You should not "svn import". That's only for importing the very first
version of any project.

svn_load_dirs.pl is great for importing old versions of a project
that you may have kept around as backups before you started using a
revision control system. When I started using Subversion, I used the
script to import years of old versions of a project I was working on
into our new repository.

Once you have all your old versions imported and you're starting new
development, you should check out a working copy and make your
changes in there. Change files. Add new files (and inform Subversion
with "svn add"). Remove obsolete files (using "svn delete" so
Subversion knows about it). Commit the changes using "svn commit".

-- 
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 Tue Jan 16 06:43:56 2007

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