From d5f2fd3a4c0a3dd2fdc2e9706963f0678d3fdcce Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 12 Mar 2016 23:30:15 +0100 Subject: [PATCH] format_archive: also output archive id, fixes #731 used by borg list, prune, delete. before: now: [] it's a bit less pretty now, but better for automation as the id always stays same while the name can be changed. --- borg/helpers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/borg/helpers.py b/borg/helpers.py index b9e176965..a23503d3c 100644 --- a/borg/helpers.py +++ b/borg/helpers.py @@ -1,4 +1,5 @@ import argparse +from binascii import hexlify from collections import namedtuple from functools import wraps import grp @@ -610,7 +611,11 @@ def sizeof_fmt_decimal(num, suffix='B', sep='', precision=2): def format_archive(archive): - return '%-36s %s' % (archive.name, format_time(to_localtime(archive.ts))) + return '%-36s %s [%s]' % ( + archive.name, + format_time(to_localtime(archive.ts)), + hexlify(archive.id).decode('ascii'), + ) def memoize(function):