Merge pull request #125 from kyrias/vcs-list-options

vcs: Add support for list options when using use_max_tag
This commit is contained in:
依云 2020-02-18 16:11:40 +08:00 committed by GitHub
commit 47c434ae3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -530,6 +530,8 @@ ignored_tags
be useful to avoid some known badly versioned tags, so the newer tags won't be useful to avoid some known badly versioned tags, so the newer tags won't
be "overridden" by the old broken ones. be "overridden" by the old broken ones.
This source supports `list options`_ when ``use_max_tag`` is set.
Other Other
----- -----
More to come. Send me a patch or pull request if you can't wait and have written one yourself :-) More to come. Send me a patch or pull request if you can't wait and have written one yourself :-)

View file

@ -54,10 +54,7 @@ async def get_version(name, conf, **kwargs):
return return
else: else:
if use_max_tag: if use_max_tag:
data = [tag for tag in output.split("\n") if tag not in ignored_tags] return [tag for tag in output.split("\n") if tag not in ignored_tags]
data.sort(key=parse_version)
version = data[-1]
return version
else: else:
oldvers = _parse_oldver(oldver) oldvers = _parse_oldver(oldver)
if output == oldvers[2]: if output == oldvers[2]: