Wednesday, April 29, 2009

Subversion. Checksum mismatch error resolution

Yesterday I faced with SVN check in problem with one file. Error occurred during commit:

svn: Checksum mismatch for '.svn/text-base/SomeFile.cs'; expected: ' 87f768d98a23d7643d6a784869aee901', actual: '34251d64fa637df34a23781264fa784f'

I think that this happened because during versions comparison of the file I used Base and Previous versions and changed the Base one (I was trying to rollback my changes).
I googled over the Internet and didn’t find appropriate solution or workaround for this error. So I spent some time to solve the problem and now I know a solution that I’m sharing here.

UPDATE. Try 'svn cleanup' command first. It may help. If so all items bellow are excess. I didn't try it mysefls, but Ilya says that it helps sometimes.

If сleanup doesn't help, then try following.

Let’s say that our problem file’s name is SomeFile.cs.

1.First of all backup ALL files from the directory with a problem file.
2.Use svn info SomeFile.cs command to get an useful information about the file and it’s properties in a repository:

Path: SomeFile.cs
Name: SomeFile.cs
Revision: 395
Node Kind: file
Schedule: normal
Last Changed Author: bashir.magomedov
Last Changed Rev: 122
Last Changed Date: 2009-04-04 16:43:13 +0300 (Mon, 04 Apr 2009)
Text Last Updated: 2009-04-21 21:18:16 +0300 (Thu, 21 Apr 2009)
Properties Last Updated: 2009-04-04 21:50:19 +0300 (Mon, 04 Apr 2009)
Checksum: /3L38YwzhT93BWvgpdF6Zw==

3.Copy value or URL property.
4.Go to the parent directory and delete directory that contains SomeFile.cs (Yes, delete whole directory with all files)
5.Run command: svn –co [URL]. But exclude file name from URL.
In our case: svn –co
6. Copy files from backup to newly created directory, and go into this directory.
7. Commit your changes using: svn ci SomeFile.cs command.
That’s it.


Ilya Troitskiy said...

Have you tried 'svn cleanup' command? It helps sometimes.

Bashir Magomedov said...

No, I haven't. But it is good idea!

ЯR said...

Thanks, it's works (and 'svn cleanup' is not).