From a65ee7d9488e940207f703da33fa39f885701adc Mon Sep 17 00:00:00 2001 From: a1exsh Date: Fri, 2 Oct 2020 15:21:47 +0200 Subject: [PATCH] Fix sort order in output of scm-source The order based on the tag doesn't match the time-based order of the `tags` command output, e.g: ``` master-10 master-11 master-2 master-3 ``` This change makes both commands produce output in the same order. --- pierone/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pierone/cli.py b/pierone/cli.py index a5308a3..f10f7ef 100644 --- a/pierone/cli.py +++ b/pierone/cli.py @@ -357,7 +357,7 @@ def scm_source(config, team, artifact, tag, url, output): row['created_time'] = parse_time(''.join([d['created'] for d in matching_tag])) rows.append(row) - rows.sort(key=lambda row: (row['tag'], row.get('created_time'))) + rows.sort(key=lambda row: (row.get('created_time'), row['tag'])) with OutputFormat(output): print_table(['tag', 'author', 'url', 'revision', 'status', 'created_time', 'created_by'], rows, titles={'tag': 'Tag', 'created_by': 'By', 'created_time': 'Created',