我在一个工作文件夹中有很多更改,在尝试进行更新时出错了。

现在当我发出'svn cleanup'时,我得到:

>svn cleanup .
svn: In directory '.'
svn: Error processing command 'modify-wcprop' in '.'
svn: 'MemPoolTests.cpp' is not under version control

MemPoolTests.cpp是另一个开发人员添加的新文件,在更新中被删除了。以前我的工作文件夹里不存在。

我能做些什么来尝试并继续前进,而不必签出存储库的新副本吗?

澄清:感谢您提出的关于将目录移出并删除一个新副本的建议。我知道这是一个选项,但这是我想避免的,因为有许多更改嵌套在几个目录深处(这应该是一个分支…)

我希望有一种更积极的方式来做清理,也许以某种方式迫使文件SVN有麻烦回到一个已知的状态(我尝试删除它的工作副本…这并没有帮助)。


当前回答

看一看

http://www.anujvarma.com/svn-cleanup-failedprevious-operation-has-not-finished-run-cleanup-if-it-was-interrupted/

以上链接修复的总结(感谢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.)

其他回答

我做了sudo chmod 777 -R。以便能够更改权限。如果没有sudo,它将无法工作,给我带来与运行其他命令相同的错误。

现在您可以执行svn update或其他操作,而不必废弃整个目录并重新创建它。这是特别有用的,因为您的IDE或文本编辑器可能已经打开了某些选项卡,或者有同步问题。您不需要使用此方法废弃并替换您的工作目录。

看一看

http://www.anujvarma.com/svn-cleanup-failedprevious-operation-has-not-finished-run-cleanup-if-it-was-interrupted/

以上链接修复的总结(感谢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.)

我将同事的.svn目录复制到我的目录中,然后更新我的工作副本,从而解决了这个问题。这是一个很好的、快速的、干净的解决方案。

每当我有类似的问题,我使用rsync(注意:我使用Linux或Mac OS X)来帮助这样:

# Go to the parent directory
cd dir_above_borked

# Rename corrupted directory
mv borked_dir borked_dir.bak

# Checkout a fresh copy
svn checkout svn://... borked_dir

# Copy the modified files to the fresh checkout
# - test rsync
#   (possibly use -c to verify all content and show only actually changed files)
rsync -nav --exclude=.svn borked_dir.bak/ borked_dir/

# - If all ok, run rsync for real
#   (possibly using -c again, possibly not using -v)
rsync -av --exclude=.svn borked_dir.bak/ borked_dir/

这样您就有了一个新的签出,但是使用相同的工作文件。 对我来说,这总是很有效。

我也有同样的问题。我不能承诺,清理工作就会失败。

使用命令行客户端,我能够看到一条错误消息,表明它无法将文件从.svn/props移动到.svn/prop-base。

我查看了特定的文件,发现它被标记为只读。删除只读属性后,我能够清理文件夹并提交我的更改。