Press "Enter" to skip to content

svnsync delete corrupted revision

Occasionally I come across an svnsync backup that refuses to sync because it has a corrupted revision.  Naturally you want to sync the whole thing again but sometimes the repo is huge and you want to have something that’s still synced in the meantime:

I’m going to presume you know the corrupt revision number which I’ll refer to as N from here on.

  1. Delete all the files in db/revs with a number equal to or higher than N
  2. Do the same for db/revprops
  3. Make db/current contain N – 1
  4. Edit db/revprops/0/0 which should look like thisK 8
    V 27
    K 17
    V 27
    K 18
    V 36
    K 24
    V 5

    change the two lines down from svn:sync-last-merged-rev to N – 1.  The Number after V on the line above should be the number of digits in your revision number.  If you see svn:sync-currently-copying then you can do the same but with N – 2 instead.

  5. Delete db/rep-cache.db  This is the only part that leaves a bad taste in the mouth.  It’ll get recreated and is  ‘risk free’ as explained here: but you can potentially end up with a bigger repo.