You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Josh Blair <jo...@gmail.com> on 2007/07/02 22:57:37 UTC

trouble with repository restructure

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

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.

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

Thanks for your insight,

-- 
Josh Blair
Golden, CO

Re: trouble with repository restructure

Posted by Hari Kodungallur <hk...@gmail.com>.
On 7/2/07, Josh Blair <jo...@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
transaction.
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 :)

regards,
-Hari Kodungallur