Friday, January 11, 2008

How to deal with the svn Checksum mismatch

I have this bad habbit to forget that I work in an svn environment and sometimes remove-copy-edit-trash-and-whatever files and folders by hand.
In an eclipse plugin environment (and not only) this can lead to great problems because of the lost sync between the local and remote repositories.
The result is something like:

commit -m "" /home/moovida/rcpdevelopment/WORKSPACES/jgrassudig33workspace/eu.hydrologis.jgrass.charting.jfreechart.libs/META-INF/MANIFEST.MF
Sending /home/moovida/rcpdevelopment/WORKSPACES/jgrassudig33workspace/eu.hydrologis.jgrass.charting.jfreechart.libs/META-INF/MANIFEST.MF
Transmitting file data ...
svn: Commit failed (details follow):
svn: Commit failed (details follow):
svn: Checksum mismatch for '/home/moovida/rcpdevelopment/WORKSPACES/jgrassudig33workspace/eu.hydrologis.jgrass.charting.jfreechart.libs/META-INF/MANIFEST.MF'; expected: 'e59ba98152ab43ed640cdf076b0cdc51', actual: '0fad1171d44dba8be24547671ef6b510'


Well, after trying to replace the local file with the remote one a couple of times:

revert -N /home/moovida/rcpdevelopment/WORKSPACES/jgrassudig33workspace/eu.hydrologis.jgrass.charting.jfreechart.libs/META-INF/MANIFEST.MF
Reverted /home/moovida/rcpdevelopment/WORKSPACES/jgrassudig33workspace/eu.hydrologis.jgrass.charting.jfreechart.libs/META-INF/MANIFEST.MF


The problem wasn't fixed yet.
The real problem is in those nice hidden svn-something files in every folder. They keep track of everything that happens.

So the deal is to remove the folder containing the corrupted file and update again.
At that point do your changes and commit. It will do so.

8 comments:

Anonymous said...

very thanks. to delete the folder which is parent directory of the file that creates problem resolved the problem.

Dave said...

yeah I can confirm this works.
Also, you can try checking out a fresh copy from subversion, apply your changes to which ever files were giving you grief, then commit from there. =D

dvdplm said...

Tried this and many other solutions. Nothing worked. On a whim I upgraded subversion from 1.4.2 to 1.6.6. Fixed it!

Rekha's Page said...

I've been got struck in the checksum mismatch problem and get solved. By just renaming the folder where the file have been a problem and update the svn. It gets solved.

Anonymous said...

Another dirty trick: Inside the folders you mentioned, specifically there is one called .svn, wich contains a file named entries. In that file you can find the checksums saved for each one of the files in your package. So the trick is to replace the checksum registered for your file with error with the one reported to you by the svn client. (The file is in read only mode, so change this first). And that's it. Thanks for your suggestion :P

Jacolyte said...

This is why I love Git, it stays out of your way.

Anonymous said...

(For Eclipse) Easiest in my opinion is to just rename the file, update and the do "Edit->Undo Rename Resource"... after that the commit will work

Anonymous said...

Got the same problem. Resolved by removing the concerned folder from my local workspace, then update (this results of fetching the right version from the svn server) and it works again :)