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
    svn:date
    V 27
    2016-04-06T12:01:06.161341Z
    K 17
    svn:sync-from-url
    V 27
    https://svn-url.tld/svn/foo
    K 18
    svn:sync-from-uuid
    V 36
    ff94535c-aa82-4106-a8e6-eccdd4e7213a
    K 24
    svn:sync-last-merged-rev
    V 5
    11297
    END

    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:  https://svn.haxx.se/users/archive-2014-01/0137.shtml but you can potentially end up with a bigger repo.

 

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *