Ver Fonte

use borg 2.0 to refer to this, not 1.3

also, some type conversions are now done in update_internal once,
not in the decode methods of the classes in item.pyx.
Thomas Waldmann há 3 anos atrás
pai
commit
d4ee968b07
2 ficheiros alterados com 8 adições e 7 exclusões
  1. 1 1
      src/borg/constants.py
  2. 7 6
      src/borg/helpers/msgpack.py

+ 1 - 1
src/borg/constants.py

@@ -128,7 +128,7 @@ class KeyType:
     # upper 4 bits are ciphersuite, 0 == legacy AES-CTR
     KEYFILE = 0x00
     # repos with PASSPHRASE mode could not be created any more since borg 1.0, see #97.
-    # in borg 1.3 all of its code and also the "borg key migrate-to-repokey" command was removed.
+    # in borg 2. all of its code and also the "borg key migrate-to-repokey" command was removed.
     # if you still need to, you can use "borg key migrate-to-repokey" with borg 1.0, 1.1 and 1.2.
     # Nowadays, we just dispatch this to RepoKey and assume the passphrase was migrated to a repokey.
     PASSPHRASE = 0x01  # legacy, attic and borg < 1.0

+ 7 - 6
src/borg/helpers/msgpack.py

@@ -6,7 +6,7 @@ We wrap msgpack here the way we need it - to avoid having lots of clutter in the
 
 Packing
 -------
-- use_bin_type = True (used by borg since borg 1.3)
+- use_bin_type = True (used by borg since borg 2.0)
   This is used to generate output according to new msgpack 2.0 spec.
   This cleanly keeps bytes and str types apart.
 
@@ -21,16 +21,17 @@ Packing
 
 Unpacking
 ---------
-- raw = False (used by borg since borg 1.3)
-  We already can use this with borg 1.3 due to the want_bytes decoder.
-  This decoder can be removed in future, when we do not have to deal with data any more that was packed the old way.
+- raw = False (used by borg since borg 2.0)
+  We already can use this with borg 2.0 due to the type conversion to the desired type in item.py update_internal
+  methods. This type conversion code can be removed in future, when we do not have to deal with data any more
+  that was packed the old way.
   It will then unpack according to the msgpack 2.0 spec format and directly output bytes or str.
 
 - raw = True (the old way, used by borg < 1.3)
 
 - unicode_errors = 'surrogateescape' -> see description above (will be used when raw is False).
 
-As of borg 1.3, we have fixed most of the msgpack str/bytes mess, #968.
+As of borg 2.0, we have fixed most of the msgpack str/bytes mess, #968.
 Borg now still needs to **read** old repos, archives, keys, ... so we can not yet fix it completely.
 But from now on, borg only **writes** new data according to the new msgpack 2.0 spec,
 thus we can remove some legacy support in a later borg release (some places are marked with "legacy").
@@ -41,7 +42,7 @@ current way in msgpack terms
 - pack with use_bin_type=True (according to msgpack 2.0 spec)
 - packs str -> raw and bytes -> bin
 - unpack with raw=False (according to msgpack 2.0 spec, using unicode_errors='surrogateescape')
-- unpacks bin to bytes and raw to str (thus we need to re-encode manually if we want bytes from "raw")
+- unpacks bin to bytes and raw to str (thus we need to convert to desired type if we want bytes from "raw")
 """
 
 from .datastruct import StableDict