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

现在当我发出'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有麻烦回到一个已知的状态(我尝试删除它的工作副本…这并没有帮助)。


当前回答

每当我有类似的问题,我使用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/

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

其他回答

只读锁定有时发生在Windows网络驱动器上。尝试断开连接并重新连接。然后清理和更新。

每当我有类似的问题,我使用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/

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

在之前的回答中有一些非常好的建议,但如果你在Windows上使用TortoiseSVN(一个好产品,但是…)时遇到问题,总是退回到命令行,首先做一个简单的“svn清理”。

在许多情况下,Windows客户端不会运行清理命令,但是使用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.)

我只是从~\. xml文件中删除了svn-xxxxxxxx文件。Svn \tmp文件夹,其中XXXXXXXX是数字。