You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Göran Törnquist <go...@cortland.se> on 2006/08/01 20:38:51 UTC
I copied to much...or in the wrong way
Hi,
I'm just starting to get the warm fuzzy feeling
when it comes to understanding the basics of
Subversion.
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?
TIA
/Göran
--
--
Göran Törnquist
--
0733-86 04 70
--
Cortland AB
Sjökarbyvägen 23
184 34 Åkersberga
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: I copied to much...or in the wrong way
Posted by Ryan Schmidt <su...@ryandesign.com>.
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