Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I restore svn control if the .svn folder has been damaged?

Tags:

svn

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?

like image 811
Eric Goodwin Avatar asked Sep 18 '08 20:09

Eric Goodwin


People also ask

How do I clean up a .SVN folder?

According to this answer and SVN change log, svn cleanup has an option to vacuum pristine copies ( /vacuum ). This is done by default starting from 1.8. From version 1.10 up it is not longer done by default, but can be run using the command svn cleanup --vacuum-pristines (see this answer).

How do I create a .SVN folder?

One way is to browse the repository to the place where you want to insert your new directory and right-click and select "Create Folder". Then right click the folder and check it out to the location where you want it. Then copy the directory of files you want to put into SVN into the folder created by the checkout.

What does .SVN folder contain?

svn folders contain clean copies of all files checked out and . tmp directories that contain temporary files created during checkouts, commits, update and other operations.


1 Answers

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.

like image 119
Sander Rijken Avatar answered Sep 21 '22 02:09

Sander Rijken