Niel de Wet
Niel de Wet

Reputation: 8398

How do I fix SVN 'Working copy text base is corrupt'?

After many happy commits to my svn repo, all of the sudden the relationship went sour...svn flipped her lid and yelled: "Working copy text base is corrupt!"

What could have caused this? How do I fix it?

Working copy text base is corrupt
svn: Commit failed (details follow):
svn: Checksum mismatch for '~/blah/.svn/text-  base/sumonet.py.svn-base'; expected: '548b9bb4b24bc580ab8694c583b28013', actual: '8b2b3cf4615de3d8520ae4841b3b0a8b'

Upvotes: 36

Views: 44862

Answers (12)

geckos
geckos

Reputation: 6279

This works for me:

svn rm --keep-local THE_CORRUPTED_FILE
svn add THE_CORRUPTED_FILE
svn ci

Upvotes: 29

Jerry Miller
Jerry Miller

Reputation: 981

I've learned not to trust having my working directory under version control. When I'm ready to commit, I do a recursive diff and copy the changes into the checked-out directory. That way, if SVN chokes, all I do is rm -Rf the checkout and do a new checkout, then repeat the copy commands.

I didn't come here looking for a solution. I came looking for a reason for this flaky behavior and found nothing. It happens even when I'm the only person using the branch and doing everything from the command line, which I trust more than Eclipse or any other interface.

Upvotes: 1

Linda Zeng
Linda Zeng

Reputation: 11

I tried everything above, clean up doesn't work. SVN recommend me to checkout a new copy. But the project is too big, and I have changed too many codes, comparing will cost a lot of time. Here is the way I solved the problem with every change retains.

  1. Delete all the .svn folders. This folder may exists one or plenty depends on the version of SVN. Just find every single one and delete it.
  2. Checkout the working folder. It will alert "not an empty folder", click "yes". Then the working copy is recovered.

Upvotes: 1

Anand Dwivedi
Anand Dwivedi

Reputation: 59

Delete Existing copy and take fresh check out your issue will be resolved .

Upvotes: 1

Jehy
Jehy

Reputation: 4899

Had this problem after filtering my dump with https://github.com/jasperlee108/svndumpfilterIN

Fixed with removing md5 checksums...

sed -i '/Text-copy-source-md5/d' eias_only.dmp

However, there can possible be some consequences...

Upvotes: 0

Gary Rush
Gary Rush

Reputation: 133

I had the same problem but none of the previous answers helped. In my case, the Subversion repository was at version 1.6, but I had allowed IntelliJ to checkout at version 1.7. There was no indication of a version mismatch other than the "svn: E200014: Base checksum mismatch" error. Simply checking out a new tree with the correct version fixed the problem.

Upvotes: 2

desmond13
desmond13

Reputation: 3139

This was the error.

svn: E155017: Working copy text base is corrupt
svn: E200014: Checksum mismatch for text base of : '/home/.../exampleFileCorrupted.cpp'
....

CLEAR SOLUTION WHICH WORKED FOR ME SMOOTHLY:

ATTENTION: Copy your file in another file outside of the SVN environment.

cp exampleFileCorrupted.cpp ~/Desktop/

then follow below:

  1. cd to the path in which you have the corrupted file (which is the one indicated after: Checksum mismatch for text base of)
  2. svn rm --force exampleFileCorrupted.cpp

    You will see : D exampleFileCorrupted.cpp

  3. Copy the file you saved before the point 1 in the SVN folder you are in with :

    cp ~/Desktop/exampleFileCorrupted.cpp .

(Don't miss the point at the end which means 'copy here')

  1. Add to svn with : svn add exampleFileCorrupted.cpp

    You will see : A exampleFileCorrupted.cpp

  2. Commit changes: svn commit -m "Commit Message"

Let me know if this helped.

Upvotes: 37

Jeevitesh Singh
Jeevitesh Singh

Reputation: 11

Do a SVN Cleanup Team->Cleanup.

Upvotes: 0

Julian Go
Julian Go

Reputation: 4492

@siddhadev script should work but for those who prefer to do it manually:

  1. Export latest revision of the problematic file as lastworkingrev.txt
  2. Get its sha1 checksum with sha1sum lastworkingrev.txt
  3. Find the subversion pristine file with find . -name "SHA1_CHECKSUM.svn-base" and overwrite it with the content of lastworkingrev.txt
  4. Commit

Upvotes: 3

ryrysz
ryrysz

Reputation: 907

  1. Copy problematic file in other place,
  2. Delete and commit file in repository,
  3. Copy your file into SVN and commit

Upvotes: 16

siddhadev
siddhadev

Reputation: 16631

With newer subversion versions there is no .svn/text-base/ directory. The .svn is stored at the working root under .svn/pristine and the error message looks like this:

Sending        README
Transmitting file data .svn: E155017: Commit failed (details follow):
svn: E155017: Working copy text base is corrupt
svn: E200014: Checksum mismatch for text base of '/home/user/tmp/svntest/README':
   expected:  1f9167bc01e5bc9bfcb928ff03d6700a
     actual:  e0a1692ff5cab91e3e3a0d02dabe0251

svn: E200003: Delta source ended unexpectedly

You could fix it by using the bash script at https://gist.github.com/siddhadev/5814802. It will replace the corrupted svn-base file with a fresh one.

Upvotes: 7

khmarbaise
khmarbaise

Reputation: 97389

Just make a separate fresh checkout and copy the changes you made in that old working copy to the new one.

Upvotes: 16

Related Questions