What should I do when 'svn cleanup' fails?
I have a lot of changes in a working folder, and something screwed up trying to do an update.
Now when I issue an 'svn cleanup' I get:
>svn cleanup .
svn: In directory '.'
svn: Error processing command 'modify-wcprop' in '.'
svn: 'MemPoolTests.cpp' is not under version control
MemPoolTests.cpp is a new file another developer added and was brought down in the update. It did not exist in my working folder before.
Is there anything I can do to try and move forward without having to checkout a fresh copy of the repository?
Clarification: Thanks for the suggestions about moving the directory out of the way and bringing down a new copy. I know that is an option, but it is one I'd like to avoid since there are many changes nested several directories deep (this should have been a branch...)
I'm hoping for a more aggressive way of doing the cleanup, maybe someway of forcing the file SVN is having trouble with back into a known state (and I tried deleting the working copy of it ... that didn't help).
When starting all over is not an option...
I deleted the log file in the .svn
directory (I also deleted the offending file in .svn/props-base
), did a cleanup, and resumed my update.
Things have changed with SVN 1.7, and the popular solution of deleting the log file in the .svn directory isn't feasible with the move to a database working-copy implementation.
Here's what I did that seemed to work:
- Delete the .svn directory for your working copy.
- Start a new checkout in a new, temporary directory.
- Cancel the checkout (we don't want to wait for everything to get pulled down).
- Run a cleanup on this cancelled checkout.
- Now we have a new .svn directory with a clean database (although no/few files)
- Copy this .svn into your old, corrupted working directory.
- Run svn update and it should bring your new partial .svn directory up to speed with your old working directory.
That's all a little confusing, process wise. Essentially, what we're doing is deleting the corrupt .svn then creating a new .svn for the same checkout path. We then move this new .svn to our old working directory and update it to the repo.
I just did this in TSVN and it seems to work fine and not require a full checkout and download.
-Jody
Take a look at
http://www.anujvarma.com/svn-cleanup-failedprevious-operation-has-not-finished-run-cleanup-if-it-was-interrupted/
Summary of fix from above link (Thanks to Anuj Varma)
Install sqlite command-line shell (sqlite-tools-win32) from http://www.sqlite.org/download.html
sqlite3 .svn/wc.db "select * from work_queue"
The SELECT should show you your offending folder/file as part of the work queue. What you need to do is delete this item from the work queue.
sqlite3 .svn/wc.db "delete from work_queue"
That’s it. Now, you can run cleanup again – and it should work. Or you can proceed directly to the task you were doing before being prompted to run cleanup (adding a new file etc.)
If all else fails:
- Check out into a new folder.
- Copy your modified files over.
- Check back in.
- Zip the old folder up somewhere (you never know + paranoia is good) before deleting it and using the new one.
The latest verion (I'm using 1.9.5) solve this problem by adding an option of "Break locks" on the clean up menu. Just make sure this check box is selected when doing clean up.