dealing with subversion corruption: merge two svndump (subversion dump) flat files using svndumptool
grab:http://svn.borg.ch/svndumptool/0.5.0/svndumptool-0.5.0.tar.gz
read:http://svn.borg.ch/svndumptool/
start by checking the dumps you made (with svnadmin) for validity (make sure you didn't include the corrupted commits in your dump)
$ python ./svndumptool-0.5.0/svndumptool.py check -A projectnamefull.dump
Checking file projectnamefull.dump
Traceback (most recent call last):
File "./svndumptool-0.5.0/svndumptool.py", line 116, in
sys.exit( func( appname, args ) )
File "/Volumes/DATA/Staff/jessesanford/svndumptool-0.5.0/svndump/tools.py", line 523, in svndump_check_cmdline
if check.execute( filename ) != 0:
File "/Volumes/DATA/Staff/jessesanford/svndumptool-0.5.0/svndump/tools.py", line 241, in execute
while dump.read_next_rev():
File "/Volumes/DATA/Staff/jessesanford/svndumptool-0.5.0/svndump/file.py", line 474, in read_next_rev
self.__skip_empty_line()
File "/Volumes/DATA/Staff/jessesanford/svndumptool-0.5.0/svndump/file.py", line 132, in __skip_empty_line
raise SvnDumpException, "expected empty line, found '%s'" % line
svndump.common.SvnDumpException: expected empty line, found ''
the above dump DID include corruption as you can see the python script bombs... what you should see is:
$ python ./svndumptool-0.5.0/svndumptool.py check -A projectname_r0to721.dump
Checking file projectname_r0to721.dump
OK
Once you are satisfied that all your dump files are clean (corruption free) and ready to be merged back into one run:
$python ./svndumptool-0.5.0/svndumptool.py merge -iprojectname_r0to721.dump -iprojectname_r724.dump -iprojectname_r726.dump -oprojectname_merged.dump
you can see that this merges dump files for a few different segments of revisions. in the above example revision 722,723,725 were corupted so i had to slice the repo into 3 different sections and then merge them all back together to minimize the loss of version history.
0 Comments:
Post a Comment
<< Home