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

Re: trouble with repository restructure

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: 2007-07-03 01:25:58 CEST

On 7/2/07, Josh Blair <josh.blair@gmail.com> wrote:
> Hello,
> I am trying to restructure part of one of my repositories. I read through
> "Pragmatic SVN" and "Practical SVN" books but never found examples that fit
> my requirements.
> Currently the structure looks like this:
> C:\work>svn ls -vR svn://svn/repos/cXMLImportLib/trunk
> 14 josh 6641 Jun 01 19:01 ASN.cs
> 14 josh 11206 Jun 01 19:01 ConfirmationRequestImporter.cs
> 14 josh 5744 Jun 01 19:01 ImportManager.cs
> 21 josh Jun 02 11:40 Properties/
> 21 josh 1568 Jun 02 11:40 Properties/AssemblyInfo.cs
> 17 josh 2137 Jun 01 19:20 cXMLImportLib.csproj
> 14 josh 914 Jun 01 19:01 cXMLImportLib.sln
> I would like to move everything that is in the
> svn://svn/repos/cXMLImportLib/trunk
> into the svn://svn/repos/cXMLImportLib/trunk/src directory.
> This obviously doesn't work:
> C:\work>svn move svn://svn/repos/cXMLImportLib/trunk
> svn://svn/repos/cXMLImportLib/trunk/src
> svn: Cannot move URL 'svn://svn/repos/cXMLImportLib/trunk' into itself

As you said, it is obvious that it will not work. Because you are moving
the directory, not the contents of the directory. It is the same as "mv
<dir> <dir>/<subdir>"

The svn mv command on the URL does not take wildcards and so moving
everything in one shot is not possible. You can create a directory called
src using "svn mkdir" and then move one file/dir at a time to the src
directory. Or you can script it out.. sort of like this:
(a) grab the output of "svn ls"; this is the list of files to move
(b) create src directory using "svn mkdir"
(c) move individiaul files from (a) into the newly created src directory.

I tried using TortoiseSVN (which I don't know much about yet) and when I
> move things, they appear to no longer be under source control. I just drug
> each item into the new path. Is there a "proper" way to achieve this in
> TortoiseSVN? I know this isn't a TortoiseSVN mailing list.
> I also tried using svn mv to move individual files and folders but I ran
> into the situation where I get this:
> C:\work\cxmlimportlib\trunk>svn mv Properties src\Properties
> A src\Properties
> D Properties\AssemblyInfo.cs
> D Properties
> To me this looks like I am about to loose the AssemblyInfo.cs file in the
> next commit after this move...but I went ahead and ran a svn ci and it looks
> like everything was committed.

If you want everything in one transaction this will be the way to do it.
Move individual files to the src directory and then commit everything in one
After you have done the above command, if you do a status (svn st), then you
should a little + sign in front of the A for src\Properties. That means that
the entire properties directory was add to src with history. However, the
move command or the status command will list all the deleted files, but will
list only the directory that was added (not the contents of the directory).

Is there a better way to achieve this kind of repository restructuring?

May be there is a better way to do it, but I find it quite similar to the
unix move command. And so I am quite happy with it :)

-Hari Kodungallur
Received on Tue Jul 3 01:26:00 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.