list: fix weird mixup of mtime/isomtime

This commit is contained in:
Marian Beermann 2017-08-07 13:01:33 +02:00
parent a836f451ab
commit 2ff29891f1
3 changed files with 9 additions and 4 deletions

View File

@ -139,7 +139,12 @@ Compatibility notes:
- dropped support and testing for Python 3.4, minimum requirement is 3.5.0.
In case your OS does not provide Python >= 3.5, consider using our binary,
which does not need an external Python interpreter.
- 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)
-----------------------------

View File

@ -1342,7 +1342,7 @@ class Archiver:
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,
@ -3127,7 +3127,7 @@ class Archiver:
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, '

View File

@ -1790,7 +1790,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
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)