tags:

views:

224

answers:

3

I did a mistake importing in an import to some SubVersion repository, and I want to revert this import.

How can I do that?

My mistake was this: Given a folder with subfolders

a \
a \ a1
a \ b1
a \ c1

I wanted to import the folder a inside a repository folder F, so the structure in the repository be

F\a

but I imported the folders a1, b1 and c1 and the repository now is

F \ a1
F \ b1
F \ c1

I'm using Tortoise Svn, so if your instructions are in terms of that, are better.

A: 

Is this the first import for the repository? Just nuke, recreate, and re-import (but do it this time).

If you were importing the tree into something other than a brand new repository, you'll have to do a bit more.

timdev
No, it is not the first import.
eKek0
+3  A: 
svn mkdir repo-base/a
svn mv repo-base/a1 repo-base/a/
svn mv repo-base/b1 repo-base/a/
svn mv repo-base/c1 repo-base/a/

where repo-base is e.g. https://svn.my.net/svn/project/trunk/

then, when you're done, check it out locally.

renaming files and moving whole directories is most reliably achieved by issuing the commands against remote paths in my experience.

wrang-wrang
A: 

I see three choices. Using a GUI like TortoiseSVN could make things easier.

  1. Fix it where you're at

    Move the folders

  2. Delete repository and try again

    Create the repository

  3. Revert change and try again

    See Revert to this revision

TJ