Strony

czwartek, 7 października 2010

subversion checksum failed

Well, it happens occasionally that in process of committing changes to the repository some weird problem with bad checksum is reported and the whole commit is blocked:


Commit failed (details below):
svn: Checksum mismatch for '/home/userdir/devel/RTTWeb-etree-branch/cherry/sql/.svn/text-base/Job.py.svn-base', expected: '947e06aeba5bd534250ad1124e3f60d6', actual:' a226478ea1900a7aebdb3bb0cb2d42d1'


How to fix it and don't lost your precious changes? Two ways:

  1. VERY, VERY, VERRRY BAD:

    • go to the .svn subdirectory, in above example /home/userdir/devel/RTTWeb-etree-branch/cherry/sql/.svn/
    • add yourself write right to entries file and open it for editing
    • now very curious find and replace 'actual' checksum with 'expected' one, but don't touch any other line/word/character in that file
    • save & commit again


  2. SAFE, CORRECT & ONLY WAY:

    • make a copy of working copy somewhere:
      cp -R /home/userdir/devel/RTTWeb-etree-branch/cherry/sql /home/userdir/backup
    • remove wrong file from working copy:
      rm /home/userdir/devel/RTTWeb-etree-branch/cherry/sql/Job.py
    • update working copy from server:
      svn up
    • copy back 'wrong checksum' file to working copy:
      cp //home/userdir/backup/Job.py /home/userdir/devel/RTTWeb-etree-branch/cherry/sql
    • commit:
      svn ci -m "recovered from checksum error"


Now guess which way to choose and why I'm so smart now? ;)