Browse Source

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.
Thomas Waldmann 9 years ago
parent
commit
e6231896cd
1 changed files with 4 additions and 0 deletions
  1. 4 0
      borg/helpers.py

+ 4 - 0
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: