Subversion Checksum Problems
OK, so I didn’t quite make this up in one week, but I’ll keep trying. Here’s a tip for SVN users who get the dreaded “checksum mismatch” (usually by entirely replacing a file instead of editing it or something, actually I’m not quite sure what the exact cause is). There are already a couple workarounds on the Internet, but this one’s pretty clean.
-
cp
theFile
theFile.bak
Save your changes. -
svn info
theFile
| grep "Last Changed Rev"
This is the last time the file changed in the repository; say it’s something like 6207. -
svn update -r
620
6
theFile
Rollback the file to the previous version, in this case 6206. -
svn update
theFile
Restore the most recent version of the file. (I’m not sure if this step is purely necessary, but it doesn’t hurt.) This should fix the checksum. -
mv
theFile.bak
theFile
Move the changed file back, and… -
svn commit
If you don’t use SVN, sorry, this post is not for you. Something more interesting next week, perhaps?