views:

2822

answers:

9

I've got a couple large checkouts where the .svn folder has become damaged so I'm getting and error, "Cleanup failed to process the following path.." And I can no longer commit or update files in that directory.

I'd just delete and do the checkout again but the whole directory is over a gig.

Is there a tool that will restore the .svn folders for specific folders without having to download everything?

I understand that it's going to have to download all the files in that one folder so that it can determine if they've been changed..but subdirectories with valid .svn folders should be fine.

Oh.. I'm a big fan of TortoiseSVN or the command line for linux.

Thoughts?

+2  A: 

is there anyone with a working checkout that you could copy the .svn folder(s) from?

Sietse
+1  A: 

I've hit this in the past and found no working solution except the "nuclear option" (i.e. delete the directory and re-checkout).

Not sure if this is your problem, but my corruption was being caused by an on-access virus scanner on the same machine as SVN server.

Ben Hoffstein
+4  A: 

If you know which folder has the damaged .svn directory, you can just delete that one directory and run an svn update again. You may have to delete the whole directory including its current contents. Of course, if the folder with the damaged .svn directory is the one containing a gigabyte, then you're back where you started.

Greg Hewgill
If you have subversion <1.5 I think this might be the only option.
humble coffee
+8  A: 

In case you have changes to the files, and cannot delete them, you can use the Subversion 1.5 feature that allows you to 'checkout with obstructions'.

Just delete the .svn directory in this directory and:
(you don't need to delete inside directories when using --depth files, thanks Eric)

In case the broken directory was the top directory of the working copy:

svn checkout --depth files --force REPOS WC

And if the directory above the broken one is still versioned run:

svn update --depth files --force WC

in that directory.
In both samples REPOS is the url in the repository that matches the broken directory, and WC is the path to the directory.

Files that were originally modified will be in the modified state after this.

Sander Rijken
I was able to avoid deleting the .svn folder in subdirectories by adding the "--depth files" siwtch to the checkout command. Could you edit the post to reflect that and maybe clarify the REPOS and WC text. Thanks!
Eric Goodwin
+1  A: 

If the subdirectories and OK and it's the subdirectories that are large, you could try a non-recursive fresh checkout.

Alexander
A: 

Make a backup of the folder that has the missing .svn

Then delete the folder

If it is the root of the checkout, you will have to re-checkout

If it is not the root, just run an update from a directory above.

Then move the backup folder on top of it. (Ideally do not move back the .svn folders)

Continue working and be sure to update/commit!

Adam
A: 

I encountered the same error today. It happened when I tried to switch branches and fail to delete one of the file that is not in svn repository. After that, the folder was locked and I can't use any command to get it work again.

I basically deleted what I had and redo the checkout. It is time consuming, but I really want to make sure svn is clear before I can start working again. Thanks!

logoin
A: 

I got into a big mess today with this error. Thank you SO much Eric Goodwin for the answer! Wish I could vote you up, but I don't have rep on here (first time login).

Ezekiel Victor
A: 

The selected solution worked for me to restore the top-level .svn folder, but it doesn't recognize the child objects, so everything seems foreign to SVN at this point, despite versioning being intact in subfolders.

Jon L.