SVN cleanup操作反覆失敗解決辦法

今天在更新項目的時候遇到一個問題,按慣例要cleanup才能重新更新。但是很不幸,在cleanup的時候又遇到了問題!

   svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted

要更新先要cleanup,但是cleanup的失敗信息又叫我cleanup……這是一個死循環!本着“內事不決問百度,外事不決問Google”的原則,終於找到一個解決辦法,參見這裏:http://www.anujvarma.com/svn-cleanup-failedprevious-operation-has-not-finished-run-cleanup-if-it-was-interrupted/

Usually, an svn cleanup fixes most issues with tortoise svn. However, I ran into an issue which caused me some grief.
The specific error I was seeing:
Previous operation has not finished; run 'cleanup' if it was interrupted

Solution:

 Somehow, svn is stuck on the previous operation. We need to remove this operation from it’s ‘work queue’.
The data is stored in the wc.db sqllite database in the offending folder.

1. Install sqllite (32 bit binary for windows) from here

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

3. sqlite .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.)

Also, svn.exe (a command line tool) is part of the Tortoise installer – but is unchecked for some reason. Just run the installer again, choose ‘modify’ and select the ‘command line tools’.

感覺這是一個設計上的缺陷:使用工作隊列來保存數據,後一個操作依賴於前一個操作的結果,一旦失敗就要使用cleanup操作。但是,當cleanup操作失敗的時候這個機制就陷入了死循環。解決辦法就從它的數據庫中直接刪除工作隊列中的數據,注意是sqlite數據庫。

由於正在做Android開發,SDK中已經自帶了sqlite3.exe工具,因此使用起來很方便。到項目的.svn目錄下找到wc.db文件,使用sqlite3打開它,執行以下命令:

  delete from work_queue;

完畢後關閉數據庫,重新打開項目,即可恢復正常操作。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章