views:

273

answers:

2

In my repository, lets say I have this:

Animal
  Dog
     Beagle
     Hound
     ...

Lets say I checked out Dog to a working directory and I realized, whoops, I really wanted to checkout Animal.

I can delete my working copy, the Dog directory, and checkout Animal, but is there way I can do so without deleting and checking out again?

If my working copy of Dog has Animal as a parent folder and I checkout Animal without deleting Dog, I get something like "subversion failed to add directory versioned same name already exists".

I'm also using tortoise. Thanks.

+1  A: 

You're looking for svn switch, which updates your working copy to reflect a new path. Modified files don't get touched, though. In TortoiseSVN, right click and select "Switch..." from the context menu.

The more common use case for svn switch is to switch between branches that are rooted from the same point, so that you can have different views of the same code. But you can switch between arbitrary paths in your repository.

John Feminella
But my parent directory, Animal, isn't under version control, so I can't switch to it, at least not from Tortoise. Maybe via command line?
Steve
I'm confused. How can your repository have Animal in it if it's not under version control? Is that a typo?
John Feminella
I did a copy (branch) to create Animal. In my working copy, Animal doesn't have the .svn directory. It's a folder that has the same name as the repository folder. So my working directory is an exact duplicate of the repository structure, but I checked out Dog to Dog. Hope that makes sense.
Steve
+1  A: 

This is not possible directly.

The easiest way is to delete your working copy and do a new checkout of Animal.

If you have any changes in Dog that you'd like to keep, move Dog to a temporary location, checkout Animal and then copy Dog back into the Animal directory.

Palmin