From e6231896cded2b293e0b37034ea52d971e6e4d8b Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 2 Nov 2015 00:14:01 +0100 Subject: [PATCH] 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. --- borg/helpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/borg/helpers.py b/borg/helpers.py index a2941ddd4..c371c7b3c 100644 --- a/borg/helpers.py +++ b/borg/helpers.py @@ -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: