windows SVN 校验和不匹配的根本原因是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5075602/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the underlying cause of an SVN checksum mismatch?
提问by Lodle
Almost every time I commit to SVN I keep getting a checksum mismatch error. I already know how to fix it (by checking out the folder and copying over the .svn folder after deleting the old one). What I want to know is what causes this as its starting to drive me insane.
几乎每次我提交到 SVN 时,我都会收到校验和不匹配错误。我已经知道如何修复它(通过检查文件夹并在删除旧文件夹后复制 .svn 文件夹)。我想知道的是是什么导致了这种情况,因为它开始让我发疯。
OS: Windows 7 SVN Client: VisualSVN, TortoiseSVN
操作系统:Windows 7 SVN 客户端:VisualSVN、TortoiseSVN
采纳答案by optimistAk
Yes, this error is a bit annoying.. There are multiple reasons this can occur, say a broken network, power outage, or say file corruption. The workaround you figured out is the best way to get over this error afaik..
是的,这个错误有点烦人。发生这种情况的原因有多种,比如网络损坏、断电或文件损坏。您想出的解决方法是克服此错误的最佳方法 afaik..
More details on the reasons and theory why this error occurs: (similar issue, where the md5 was being null; where as in your case its a different value than whats on the server)
有关发生此错误的原因和理论的更多详细信息:(类似的问题,其中 md5 为空;在您的情况下,它的值与服务器上的值不同)
回答by Dee
1.Rename corrupted file in your working directory
1.重命名工作目录中损坏的文件
2.Commit (it will delete the corrupted file from repository, and add the renamed one)
2.Commit(它将从存储库中删除损坏的文件,并添加重命名的文件)
3.Rename file back to original name in your working directory
3.将文件重命名回工作目录中的原始名称
4.Commit
4.提交
Work like a charm for me, hope it helps.
工作对我来说就像一种魅力,希望它有所帮助。
回答by Corneil du Plessis
This solution I can across a while ago is to open a command shell in the folder where the problem file is located and execute the following:
前段时间我可以解决的这个解决方案是在问题文件所在的文件夹中打开一个命令shell并执行以下操作:
svn update --set-depth empty
svn update --set-depth infinity
I cannot remember where I found the solution, I would like to give credit where due but I can't remember, I found this in shell command history.
我不记得我在哪里找到了解决方案,我想在到期时给予信任,但我不记得了,我在 shell 命令历史记录中找到了这个。
回答by Nicki
I had an error like this. The easiest solution I found, was deleting the folder that the fil was in and then updating in my svn client of choice.
我有这样的错误。我找到的最简单的解决方案是删除 fil 所在的文件夹,然后在我选择的 svn 客户端中更新。
This restores the checksums from the server.
这将从服务器恢复校验和。
Only problem is, of course, that any changes you've made before that last commit will be lost. If it's a simple source text file, you can copy the whole content to notepad (or whatever text editor), update the svn, then copy the source text into the file again and commit.
当然,唯一的问题是,您在上次提交之前所做的任何更改都将丢失。如果它是一个简单的源文本文件,您可以将整个内容复制到记事本(或任何文本编辑器),更新 svn,然后再次将源文本复制到文件中并提交。
回答by null
This once happened to me in eclipse svn plugin, I committed some files and then I clicked cancel button when it's in progress. Then I got error same as yours. It seems the svn server had received the committed files and updated the checksums, but in my local svn, the files are still pointing to old checksums.
这曾经在 eclipse svn 插件中发生在我身上,我提交了一些文件,然后在执行过程中单击了取消按钮。然后我得到了和你一样的错误。svn 服务器似乎已经收到提交的文件并更新了校验和,但是在我的本地 svn 中,文件仍然指向旧的校验和。
My solution is to delete/move the folder that contains problem files, then I checked out or updated again the folder.
我的解决方案是删除/移动包含问题文件的文件夹,然后我再次检出或更新该文件夹。
回答by iadd
- First of all, you need to connect SQLite database (.svn\wc.db)
Get checksum of file:
SELECT CHECKSUM FROM NODES WHERE REPOS_PATH LIKE '%FILE_NAME%'
You need to delete record in both table NODES and PRISTINE:
DELETE FROM NODES WHERE CHECKSUM = 'CHECKSUM from 2.' DELETE FROM PRISTINE WHERE CHECKSUM = 'CHECKSUM from 2.'
- 首先需要连接SQLite数据库(.svn\wc.db)
获取文件校验和:
SELECT CHECKSUM FROM NODES WHERE REPOS_PATH LIKE '%FILE_NAME%'
您需要删除表 NODES 和 PRISTINE 中的记录:
DELETE FROM NODES WHERE CHECKSUM = 'CHECKSUM from 2.' DELETE FROM PRISTINE WHERE CHECKSUM = 'CHECKSUM from 2.'
It's worked for me.
它对我有用。