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

Re: I copied to much...or in the wrong way

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-08-01 23:16:49 CEST

On Aug 1, 2006, at 22:38, Göran Törnquist wrote:

> I recently copied a directory belonging to another repository and
> thought that my "svn add" would make it forget the .svn directory
> items being present. I was proved wrong.
>
> This is what I did:
>
> cp projectA/files/module1 projectB/files/module2
>
> Now I have "svn info" of projectB/files/module2 telling me that
> the URL is
> URL: http://svnserver.example.com/svn/projectA/files/module1
> instead of
> URL: http://svnserver.example.com/svn/projectB/files/module2
>
> How would I either clean the directory structure from subversion
> info, or rather just add it to the current repository?

A number of things:

1. You should probably not copy and then add or import the directory
like you're doing. If the directory is 100MB large, say, then the
repository already contains (at least) 100MB of data for these files.
If you now tell Subversion to forget that it's a working copy, and
import or add them somewhere else in the repository, another 100MB of
space will be used in the repository.

However, if you tell Subversion to make a copy of it, that copy will
take 0MB because all Subversion has to do is record that all these
files are the same as other files that are already in the repository.
Only when you start making changes to the copied files do they start
taking up space.

So, you should probably

svn cp \
http://svnserver.example.com/svn/projectA/files/module1 \
http://svnserver.example.com/svn/projectB/files/module2 \
-m "Copying projectA module1 to projectB module2"

This has the added benefit that if you ask for the history of a file
in projectB module2, it can still trace back to the history the file
has in projectA module1. With your method, the history would end at
the point where you made the new import, and it would look like you
just created the files at that point, which is probably not true.

2. If you really wanted to import the files again with no links to
the files that are already in the repository, you could use "svn
import" because svn import knows to discard the .svn directories in a
working copy.

Alternately, if you wanted to place the directory of files from
projectA into an extant working copy of projectB and "svn add" it,
then you would need to first delete the .svn directories. Subversion
provides a command to do this: svn export.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Aug 1 23:18:41 2006

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.