yodamad / svn2git

Tool to help and automate migration from SVN to GitLab
Apache License 2.0
38 stars 12 forks source link

[Idea] Check for free space before starting task #135

Open vdebosse opened 3 years ago

vdebosse commented 3 years ago

Hi, After migrating huge projects and running out of space in the middle, I thought that we could have an option to check the size of the SVN repository against the available space on /tmp, before proceeding. It will save a lot of troubles for large repositories or VM with only a little space to spare. I call it an option because it takes some time (over 10% overhead), but when disk space is an issue, this may be worth it. The command I have found and tested is: svn list -vR <svn://repository> | awk '{tmp=match($3,/[0-9]/);if(tmp){sum+=$3; i++}} END {print "\ntotal size= " sum/1024000" MB" "\nnumber of files= " i/1000 " K"}' It is a bit pessimistic but overall quite accurate.

This requires either a linux shell for awk or a manual parsing in Java instead.