emit a deprecation warning for --compression N

deprecating it in the source is not enough, we also need to tell the users to fix their scripts.
This commit is contained in:
Thomas Waldmann 2015-11-02 00:14:01 +01:00
parent 6d0570a6f7
commit e6231896cd
1 changed files with 4 additions and 0 deletions

View File

@ -405,6 +405,10 @@ def CompressionSpec(s):
raise ValueError
# DEPRECATED: it is just --compression N
if 0 <= compression <= 9:
print('Warning: --compression %d is deprecated, please use --compression zlib,%d.' % (compression, compression))
if compression == 0:
print('Hint: instead of --compression zlib,0 you could also use --compression none for better performance.')
print('Hint: archives generated using --compression none are not compatible with borg < 0.25.0.')
return dict(name='zlib', level=compression)
raise ValueError
except ValueError: