mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-01 12:45:34 +00:00
list: fix weird mixup of mtime/isomtime
(cherry picked from commit 2ff29891f1
)
This commit is contained in:
parent
818e5c8e01
commit
fa65c9b143
3 changed files with 16 additions and 3 deletions
|
@ -131,6 +131,19 @@ The best check that everything is ok is to run a dry-run extraction::
|
|||
Changelog
|
||||
=========
|
||||
|
||||
Version 1.1.0rc2 (not released yet)
|
||||
------------------------------------
|
||||
|
||||
Compatibility notes:
|
||||
|
||||
- list: corrected mix-up of "isomtime" and "mtime" formats. Previously,
|
||||
"isomtime" was the default but produced a verbose human format,
|
||||
while "mtime" produced a ISO-8601-like format.
|
||||
The behaviours have been swapped (so "mtime" is human, "isomtime" is ISO-like),
|
||||
and the default is now "mtime".
|
||||
"isomtime" is now a real ISO-8601 format ("T" between date and time, not a space).
|
||||
|
||||
|
||||
Version 1.1.0rc1 (2017-07-24)
|
||||
-----------------------------
|
||||
|
||||
|
|
|
@ -1334,7 +1334,7 @@ def _list_archive(self, args, repository, manifest, key, write):
|
|||
elif args.short:
|
||||
format = "{path}{NL}"
|
||||
else:
|
||||
format = "{mode} {user:6} {group:6} {size:8} {isomtime} {path}{extra}{NL}"
|
||||
format = "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}"
|
||||
|
||||
def _list_inner(cache):
|
||||
archive = Archive(repository, key, manifest, args.location.archive, cache=cache,
|
||||
|
@ -3119,7 +3119,7 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True):
|
|||
help='only print file/directory names, nothing else')
|
||||
subparser.add_argument('--format', '--list-format', metavar='FORMAT', dest='format',
|
||||
help='specify format for file listing '
|
||||
'(default: "{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{NL}")')
|
||||
'(default: "{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}{NL}")')
|
||||
subparser.add_argument('--json', action='store_true',
|
||||
help='Only valid for listing repository contents. Format output as JSON. '
|
||||
'The form of ``--format`` is ignored, '
|
||||
|
|
|
@ -1787,7 +1787,7 @@ def test_list_format(self):
|
|||
output_warn = self.cmd('list', '--list-format', '-', test_archive)
|
||||
self.assert_in('--list-format" has been deprecated.', output_warn)
|
||||
output_1 = self.cmd('list', test_archive)
|
||||
output_2 = self.cmd('list', '--format', '{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{NEWLINE}', test_archive)
|
||||
output_2 = self.cmd('list', '--format', '{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}{NEWLINE}', test_archive)
|
||||
output_3 = self.cmd('list', '--format', '{mtime:%s} {path}{NL}', test_archive)
|
||||
self.assertEqual(output_1, output_2)
|
||||
self.assertNotEqual(output_1, output_3)
|
||||
|
|
Loading…
Reference in a new issue