tag_re = tag_re.format(tag_number='(?P<tag_number>[0-9]{1,5})')
keyws['tag_number'] = 0
- tags_refs = repo.run_cmd(['ls-remote', '--refs', '--tags', '-q'])
- for existing_tag in ["".join(d.split()[1].split('/', 2)[2:]) for d in tags_refs.splitlines()]:
+ for existing_tag in repo.run_cmd('tag').splitlines():
match = re.match(tag_re, existing_tag)
if match and int(match.group('tag_number')) >= keyws['tag_number']:
# Get a list of all matching tags
tag_pattern = tag_name.format(**str_fields)
- revs = repo.run_cmd(['ls-remote', '--refs', '--tags', 'origin', '-q', tag_pattern]).splitlines()
- tags = ["".join(d.split()[1].split('/', 2)[2:]) for d in revs]
+ tags = repo.run_cmd(['tag', '-l', tag_pattern]).splitlines()
log.debug("Found %d tags matching pattern '%s'", len(tags), tag_pattern)
# Parse undefined fields from tag names