Fix Subversion “checksum mismatch” error by editing .svn/entries file

本文介绍了一种解决Subversion中出现的“检查和不匹配”错误的方法。通过更新.svn/entries文件中的校验和,可以绕过此问题并成功提交更改。

I can’t explain why this happened because in my several-year-long history with Subversion, I’ve never experienced this issue once. However, today, I fell into the (arguably) unfortunate circumstance of running into a most disturbing error from SVN. When trying to commit my changes, SVN barfed at me and complained of a “checksum mismatch”. It looked something like this:

Transmitting file data ..svn: Commit failed (details follow):
svn: Checksum mismatch for '/Users/maymay/Sites/path/to/subversion/working/copy/.svn/text-base/working-file.php.svn-base'; expected 'cde4d8fbd5c623da3a8b1a343aa7b3f4', actual: '270b2f20804a5fcdbd15eec5910f6e3f'

Of course, the path/to/subversion/working/copy bit was the path to my working copy file’s parent directory and the working-file.php was an actual file in my working directory.

I think what Subversion was trying to tell me is that its hashed copy of the working-file.php file and the copy I was asking it to commit weren’t the same. It would be nice if it would actually tell me why that happened, but it’s clearly more temperamental than that.

Anyway, to fix this issue (at least for now…?) I simply checked out a new working copy of this directory, examined the .svn/entries file from it and sure enough, found the actual checksums in there, just as Subversion reported expecting. I simply copied those expected checksums into the .svn/entries overwriting the old actual checksums and, voila, Subversion has been fooled. After that, I could commit my changes.

Step by step (because I’m sure someone, somewhere, somehow, will run into this again—if it’s not me that is!), this procedure looked like this:

  1. Copy the “expected” and “actual” checksums Subversion reports to you to a new text file so you can refer to them later. Note which one is the expected and which is the actual checksum.
  2. Go to where the problem is (that is, cd path/to/broken-files-parent-dir/.svn )
  3. Open the entries for editing (for example, vim entries )
  4. Search the file for the actual checksum.
  5. Replace it with the expected checksum. Be careful not to change any other part of the file.
  6. Save the file.
  7. Try to svn commit again.
  8. Lather, rinse, and repeat for any other files Subversion barfs at you about.

I’m sure this is not an elegant or even the recommended solution to this problem. The truth is I never bothered to look up what the recommended solution is, because it seems to me that any code repository that can’t guarantee what I get out of it is the same as what I put into it isn’t a versioning system I really want to trust the “recommended” solution of, anyway.

内容概要:本文介绍了基于Matlab代码实现的【EI复现】考虑网络动态重构的分布式电源选址定容优化方法,重点研究在电力系统中结合网络动态重构技术进行分布式电源(如光伏、风电等)的最佳位置选择与容量配置的双层优化模型。该方法综合考虑配电网结构变化与电源布局之间的相互影响,通过优化算法实现系统损耗最小、电压稳定性提升及可再生能源消纳能力增强等多重目标。文中提供了完整的Matlab仿真代码与案例验证,便于复现实验结果并拓展应用于微网、储能配置与配电系统重构等相关领域。; 适合人群:电力系统、电气工程及其自动化等相关专业的研究生、科研人员及从事新能源规划与电网优化工作的工程师;具备一定Matlab编程基础和优化理论背景者更佳。; 使用场景及目标:①用于科研论文复现,特别是EI/SCI级别关于分布式能源优化配置的研究;②支【EI复现】考虑网络动态重构的分布式电源选址定容优化方法(Matlab代码实现)撑毕业设计、课题项目中的电源选址定容建模与仿真;③辅助实际电网规划中对分布式发电接入方案的评估与决策; 阅读建议:建议结合提供的网盘资源下载完整代码与工具包(如YALMIP),按照文档目录顺序逐步学习,注重模型构建思路与代码实现细节的对应关系,并尝试在不同测试系统上调试与扩展功能。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值