From add890fbea5216797dbdd4f11d6b197644db3465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= Date: Tue, 18 Feb 2020 03:05:01 +0100 Subject: [PATCH] vcs: Add support for list options when using use_max_tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- README.rst | 2 ++ nvchecker/source/vcs.py | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index f02ffd9..e59bfae 100644 --- a/README.rst +++ b/README.rst @@ -530,6 +530,8 @@ ignored_tags be useful to avoid some known badly versioned tags, so the newer tags won't be "overridden" by the old broken ones. +This source supports `list options`_ when ``use_max_tag`` is set. + Other ----- More to come. Send me a patch or pull request if you can't wait and have written one yourself :-) diff --git a/nvchecker/source/vcs.py b/nvchecker/source/vcs.py index 03bede0..5d55d56 100644 --- a/nvchecker/source/vcs.py +++ b/nvchecker/source/vcs.py @@ -54,10 +54,7 @@ async def get_version(name, conf, **kwargs): return else: if use_max_tag: - data = [tag for tag in output.split("\n") if tag not in ignored_tags] - data.sort(key=parse_version) - version = data[-1] - return version + return [tag for tag in output.split("\n") if tag not in ignored_tags] else: oldvers = _parse_oldver(oldver) if output == oldvers[2]: