mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +01:00
OP-1926: fixed the xxx+r0-g1234 on tags which shouldn't exist
I was erroneously comparing string to int
This commit is contained in:
parent
fd56ad79c5
commit
b73dba5093
@ -165,7 +165,7 @@ class Repo:
|
|||||||
|
|
||||||
def tag(self, none = None):
|
def tag(self, none = None):
|
||||||
"""Return git tag for the HEAD commit or given string if none"""
|
"""Return git tag for the HEAD commit or given string if none"""
|
||||||
if self._last_tag == None or self._num_commits_past_tag != 0:
|
if self._last_tag == None or self._num_commits_past_tag != "0":
|
||||||
return none
|
return none
|
||||||
else:
|
else:
|
||||||
return self._last_tag
|
return self._last_tag
|
||||||
@ -187,7 +187,7 @@ class Repo:
|
|||||||
def label(self):
|
def label(self):
|
||||||
"""Return package label (similar to git describe)"""
|
"""Return package label (similar to git describe)"""
|
||||||
try:
|
try:
|
||||||
if self._num_commits_past_tag == 0:
|
if self._num_commits_past_tag == "0":
|
||||||
return self._last_tag + self.dirty()
|
return self._last_tag + self.dirty()
|
||||||
else:
|
else:
|
||||||
return self._last_tag + "+r" + self._num_commits_past_tag + "-g" + self.hash(7, '') + self.dirty()
|
return self._last_tag + "+r" + self._num_commits_past_tag + "-g" + self.hash(7, '') + self.dirty()
|
||||||
@ -197,7 +197,7 @@ class Repo:
|
|||||||
def revision(self):
|
def revision(self):
|
||||||
"""Return full revison string (tag if defined, or branch:hash date time if no tag)"""
|
"""Return full revison string (tag if defined, or branch:hash date time if no tag)"""
|
||||||
try:
|
try:
|
||||||
if self._num_commits_past_tag == 0:
|
if self._num_commits_past_tag == "0":
|
||||||
return self.tag('') + self.dirty()
|
return self.tag('') + self.dirty()
|
||||||
else:
|
else:
|
||||||
return self.branch('no-branch') + ":" + self.hash(8, 'no-hash') + self.dirty() + self.time(' %Y%m%d %H:%M')
|
return self.branch('no-branch') + ":" + self.hash(8, 'no-hash') + self.dirty() + self.time(' %Y%m%d %H:%M')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user