X-Git-Url: https://arthur.barton.de/gitweb/?p=bup.git;a=blobdiff_plain;f=lib%2Fcmd%2Fsave-cmd.py;h=37155cb2e2a66ca68e4808790d828836e397be20;hp=5cdedf65f1c10bdb362802d7cb3f1bb034229271;hb=e03bee7f751e0a092509200502e0f37316458536;hpb=f6abe5795cc39e316c7198666cc65d53b582296f diff --git a/lib/cmd/save-cmd.py b/lib/cmd/save-cmd.py index 5cdedf6..37155cb 100755 --- a/lib/cmd/save-cmd.py +++ b/lib/cmd/save-cmd.py @@ -487,8 +487,13 @@ if opt.tree: out.write(hexlify(tree)) out.write(b'\n') if opt.commit or name: - msg = (b'bup save\n\nGenerated by command:\n%r\n' - % [argv_bytes(x) for x in sys.argv]) + 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 compat.argv]) + else: + msgcmd = repr(compat.argv) + msg = b'bup save\n\nGenerated by command:\n%s\n' % msgcmd userline = (b'%s <%s@%s>' % (userfullname(), username(), hostname())) commit = w.new_commit(tree, oldref, userline, date, None, userline, date, None, msg)