Fix: Another versioneer branch issue
This commit is contained in:
parent
7affce2f64
commit
babbbf696e
2 changed files with 37 additions and 4 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -1,5 +1,15 @@
|
|||
# OctoPrint Changelog
|
||||
|
||||
## 1.1.3 (unreleased)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed another instance of a missing `branch` fields in version dicts generated by versioneer (compare
|
||||
[#634](https://github.com/foosel/OctoPrint/pull/634)). Caused an issue when installing from source archive
|
||||
downloaded from Github.
|
||||
|
||||
([Commits](https://github.com/foosel/OctoPrint/compare/1.1.2...master))
|
||||
|
||||
## 1.1.2 (2015-03-23)
|
||||
|
||||
### Improvements
|
||||
|
|
|
|||
|
|
@ -369,6 +369,17 @@ def versions_from_expanded_variables(variables, tag_prefix, verbose=False):
|
|||
tags = set([r for r in refs if re.search(r'\d', r)])
|
||||
if verbose:
|
||||
print("discarding '%%s', no digits" %% ",".join(refs-tags))
|
||||
|
||||
branches = [r for r in refs if not r.startswith(TAG) and r != "HEAD" and not r.startswith("refs/")]
|
||||
if branches:
|
||||
branch = branches[0]
|
||||
else:
|
||||
branch = "unknown"
|
||||
|
||||
if verbose:
|
||||
print("likely tags: %s" % ",".join(sorted(tags)))
|
||||
print("likely branches: %s" % ",".join(sorted(branches)))
|
||||
|
||||
if verbose:
|
||||
print("likely tags: %%s" %% ",".join(sorted(tags)))
|
||||
for ref in sorted(tags):
|
||||
|
|
@ -378,12 +389,14 @@ def versions_from_expanded_variables(variables, tag_prefix, verbose=False):
|
|||
if verbose:
|
||||
print("picking %%s" %% r)
|
||||
return { "version": r,
|
||||
"full": variables["full"].strip() }
|
||||
"full": variables["full"].strip(),
|
||||
"branch": branch}
|
||||
# no suitable tags, so we use the full revision id
|
||||
if verbose:
|
||||
print("no suitable tags, using full revision id")
|
||||
return { "version": variables["full"].strip(),
|
||||
"full": variables["full"].strip() }
|
||||
"full": variables["full"].strip(),
|
||||
"branch": "unknown"}
|
||||
|
||||
def versions_from_lookup(lookup, root, verbose=False):
|
||||
GITS = get_gits(root, verbose=verbose)
|
||||
|
|
@ -635,8 +648,17 @@ def versions_from_expanded_variables(variables, tag_prefix, verbose=False):
|
|||
tags = set([r for r in refs if re.search(r'\d', r)])
|
||||
if verbose:
|
||||
print("discarding '%s', no digits" % ",".join(refs-tags))
|
||||
|
||||
branches = [r for r in refs if not r.startswith(TAG) and r != "HEAD" and not r.startswith("refs/")]
|
||||
if branches:
|
||||
branch = branches[0]
|
||||
else:
|
||||
branch = "unknown"
|
||||
|
||||
if verbose:
|
||||
print("likely tags: %s" % ",".join(sorted(tags)))
|
||||
print("likely branches: %s" % ",".join(sorted(branches)))
|
||||
|
||||
for ref in sorted(tags):
|
||||
# sorting will prefer e.g. "2.0" over "2.0rc1"
|
||||
if ref.startswith(tag_prefix):
|
||||
|
|
@ -644,13 +666,14 @@ def versions_from_expanded_variables(variables, tag_prefix, verbose=False):
|
|||
if verbose:
|
||||
print("picking %s" % r)
|
||||
return { "version": r,
|
||||
"full": variables["full"].strip() }
|
||||
"full": variables["full"].strip(),
|
||||
"branch": branch }
|
||||
# no suitable tags, so we use the full revision id
|
||||
if verbose:
|
||||
print("no suitable tags, using full revision id")
|
||||
return { "version": variables["full"].strip(),
|
||||
"full": variables["full"].strip(),
|
||||
"branch": ""}
|
||||
"branch": "unknown"}
|
||||
|
||||
|
||||
def versions_from_lookup(lookup, root, verbose=False):
|
||||
|
|
|
|||
Loading…
Reference in a new issue