Skip to content
Snippets Groups Projects
Commit e44a68ab authored by William Salmon's avatar William Salmon
Browse files

Search for tags with the *.*.* patten for version

This has been done in a way that I hope might be able to be upstreamed
in to versioneer. This is not garanteed but it would be good if it
could be.
parent d87a3123
No related branches found
No related tags found
No related merge requests found
Pipeline #27137532 failed
......@@ -43,6 +43,7 @@ def get_config():
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.tag_regex = "*.*.*"
cfg.parentdir_prefix = "BuildStream-"
cfg.versionfile_source = "buildstream/_version.py"
cfg.verbose = False
......@@ -215,7 +216,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
@register_vcs_handler("git", "pieces_from_vcs")
def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
def git_pieces_from_vcs(tag_prefix, tag_regex, root, verbose, run_command=run_command):
"""Get version from 'git describe' in the root of the source tree.
This only gets called if the git-archive 'subst' keywords were *not*
......@@ -237,7 +238,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
# if there isn't one, this yields HEX[-dirty] (no NUM)
describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty",
"--always", "--long",
"--match", "%s*" % tag_prefix],
"--match", "%s%s*" % (tag_prefix, tag_regex)],
cwd=root)
# --long was added in git-1.5.5
if describe_out is None:
......@@ -505,7 +506,7 @@ def get_versions():
"date": None}
try:
pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
pieces = git_pieces_from_vcs(cfg.tag_prefix, cfg.tag_regex, root, verbose)
return render(pieces, cfg.style)
except NotThisMethod:
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment