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

Re: Fixing a bad import

From: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2006-01-25 10:40:22 CET

On Jan 25, 2006, at 04:24, Joshua Kolden wrote:

> So I accidentally did an incorrect import:
>
> svn import "myProj" svn+ssh://me@server/srv/svn/
>
> Now of course the files and folders in "myProj" are spewed over the
> top level of the svn server. I know how much svn doesn't like to
> actually delete things, so how do I get rid of these files? In
> general how can I easily fix mistakes like this.

1.
svn mkdir svn+ssh://me@server/srv/svn/myProj \
-m "Making myProj directory"

2.
svn mv \
svn+ssh://me@server/srv/svn/someItemOfMyProj \
svn+ssh://me@server/srv/svn/myProj/someItemOfMyProj \
-m "Moving someItemOfMyProj into myProj"

3.
goto 2 until done

Or, if you want to do it in a single revision, instead of one per move:

1.
svn co -N svn+ssh://me@server/srv/svn workingCopy

2.
cd workingCopy

3.
svn mkdir myProj

4.
svn up someItemOfMyProj

5.
svn mv someItemOfMyProj myProj/

6.
goto 4 until done

7.
svn ci -m "Moving all parts of myProj into myProj/"

In general, fixing mistakes like this is not so easy, as you see, so
it's advisable to not make the mistake in the first place. :-P Create
documentation for yourself and your team to follow which shows the
exact commands to enter for specific operations, like initially
importing a project, and follow them. I never remember the commands
to import or update a vendor project, for example, and always have to
consult my documentation page on that.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jan 25 10:42:36 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.