修复损坏的 SVN 存储库 [英] Repair corrupted SVN repository

查看:50
本文介绍了修复损坏的 SVN 存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Mac OS X Lion (10.7.2 11C74) 上使用 svnX (0.9.13) 并且我认为似乎有一个损坏的 SVN 存储库.我在该网站上搜索过类似的问题,并找到一个夫妇,但没有描述当您无法完成结帐 从存储库.我也没有最新的工作目录.

I am using svnX (0.9.13) on Mac OS X Lion (10.7.2 11C74) and have seem to have, what I believe, is a corrupted SVN repository. I have searched the site for similar questions and have found a couple, yet none describe how to recover when you cannot complete a checkout from the repository. I do not have an up to date working directory either.

具体的错误是:

svn:读取表示时校验和不匹配:
预期:[哈希]
实际:[不同的哈希值]

svn: Checksum mismatch while reading representation:
expected: [hash]
actual: [different hash]

如果提醒被解除(唯一的选择),结帐将持续到结束.乍一看,大多数文件似乎都在那里,但是当我运行该应用程序时,很明显版本混杂.存储库位于 USB 闪存驱动器上,这可能是损坏的来源.我是唯一访问这些文件的用户,并且它们已经超过一个星期没有被触动并且处于工作状态.

If the alert is dismissed (the only option), the checkout will continue until the end. On first glance, most of the files seem to be there, but when I run the application, it is clear there is a mishmash of versions. The repository lives on a USB flash drive, which could be a source of corruption. I am the only user who access these files and they have not been touched for over a week and were in a working state.

对如何进行的任何建议将不胜感激.

Any suggestions on how to proceed would be appreciated.

推荐答案

当您有一个损坏的存储库时,保存信息的唯一真正机会就是进行转储和加载.如果幸运的话,执行转储和加载有时会纠正损坏.

When you have a corrupt repository, your only real chance in saving the information is to do a dump and load. If you're lucky, doing a dump and load will sometimes correct the corruption.

如果没有,您可以在转储中使用 -r <from>:<to> 参数来跳过错误的修订版.您可以创建多个转储文件并将它们合并到一个存储库中,这样您就可以跳过错误的修订号.我注意到每个转储文件都以该版本的存储库的完整修订开始,并且转储/加载过程通常足够智能,不会使更改加倍.

If not, you can use the -r <from>:<to> parameter on the dump to skip over the bad revisions. You can create several dump files and merge them into a single repository, so you can skip over the bad revision numbers. I've noticed that each dump file starts with a complete revision of the repository at that revision, and the dump/load process is usually smart enough not to double up changes.

事实上,我相信您甚至可以将多个转储文件放入一个转储文件中,不会有太多问题.以下内容应跳过修订版 1001 和 1204,它们是错误的修订版:

In fact, I believe you can even put several dumps into a single dump file without too many problems. The following should skip over revisions 1001 and 1204 which are bad revisions:

$ svnadmin dump -r1:1000 my_repos > dumpfile.txt
$ svnadmin dump --incremental -r1002:1203 my_repos >> dumpfile.txt
$ svnadmin dump --incremental -r1205:HEAD my_repos >> dumpfile.txt
$ svnadmin load my_repos2 < dumpfile.txt

有几个 Subversion 备份脚本通过获取最新修订的转储来备份存储库.例如,第一次运行它时,它会转储从第一个修订版到最后一个版本(比如修订版 1000)的所有内容.然后,第二天它将修订版 1001 转储到最后一个修订版(比如 1003),第二天将修订版 1004 转储到最后一个修订版.

There are several Subversion backup scripts that backup the repository by taking dumps of the newest revisions. For example, the first time you run it, it dumps everything from the first revision to the last version (say revision 1000). Then, the next day it dumps revision 1001 to the last revision (say 1003), and the next day, revision 1004 to the last revision.

要恢复,您必须恢复所有转储,但假设备份时间比每次都执行完整转储要短.

To restore, you have to restore all the dumps, but the backup times are suppose to be shorter than doing a full dump each time.

您也可以进行热拷贝,但我发现进行热拷贝的速度并不比转储快得多,而且如果您必须将存储库移动到另一台机器上,可能会出现问题.

You can also do a hotcopy, but I don't find doing a hotcopy that much faster than doing a dump, and there could be issues if you have to move your repository to a different machine.

这篇关于修复损坏的 SVN 存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆