]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/cmd/save.py
Require python 3.7+
[bup.git] / lib / bup / cmd / save.py
index 88f74d77b9216bac94acdca2bc3a4360c97b6969..78fc79d2bbc152dfd4c0a83e96533c0bb05b09bd 100644 (file)
@@ -5,7 +5,7 @@ from errno import ENOENT
 from io import BytesIO
 import math, os, stat, sys, time
 
-from bup import compat, hashsplit, git, options, index, client, metadata
+from bup import hashsplit, git, options, index, client, metadata
 from bup import hlinkdb
 from bup.compat import argv_bytes, environ, nullcontext
 from bup.hashsplit import GIT_MODE_TREE, GIT_MODE_FILE, GIT_MODE_SYMLINK
@@ -463,12 +463,9 @@ def save_tree(opt, reader, hlink_db, msr, w):
 
 
 def commit_tree(tree, parent, date, argv, writer):
-    if compat.py_maj > 2:
-        # Strip b prefix from python 3 bytes reprs to preserve previous format
-         msgcmd = b'[%s]' % b', '.join([repr(argv_bytes(x))[1:].encode('ascii')
-                                       for x in argv])
-    else:
-        msgcmd = repr(argv)
+    # Strip b prefix from python 3 bytes reprs to preserve previous format
+    msgcmd = b'[%s]' % b', '.join([repr(argv_bytes(x))[1:].encode('ascii')
+                                   for x in argv])
     msg = b'bup save\n\nGenerated by command:\n%s\n' % msgcmd
     userline = (b'%s <%s@%s>' % (userfullname(), username(), hostname()))
     return writer.new_commit(tree, parent, userline, date, None,