Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should I do when 'svn cleanup' fails?

Tags:

svn

People also ask

Why does SVN cleanup?

Description. Recursively clean up the working copy, removing working copy locks and resuming unfinished operations. If you ever get a “working copy locked” error, run this command to remove stale locks and get your working copy into a usable state again.

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 get rid of TortoiseSVN?

How do I uninstall TortoiseSVN? Simply uninstall from Add/Remove Programs in the Windows control panel. This does not affect your repositories or working copies at all.


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:

  1. Delete the .svn directory for your working copy.
  2. Start a new checkout in a new, temporary directory.
  3. Cancel the checkout (we don't want to wait for everything to get pulled down).
  4. Run a cleanup on this cancelled checkout.
  5. Now we have a new .svn directory with a clean database (although no/few files)
  6. Copy this .svn into your old, corrupted working directory.
  7. 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)

  1. Install sqlite command-line shell (sqlite-tools-win32) from http://www.sqlite.org/download.html

  2. 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.

  1. 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:

  1. Check out into a new folder.
  2. Copy your modified files over.
  3. Check back in.
  4. Zip the old folder up somewhere (you never know + paranoia is good) before deleting it and using the new one.