diff options
author | Simon Schampijer <simon@schampijer.de> | 2010-09-30 09:38:04 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2010-09-30 09:38:04 (GMT) |
commit | 1d55d7d8659279ed33c0b413f4bd4b2475364079 (patch) | |
tree | db5d3cc41ac3e004edd1fc195e143a8a5596c02c | |
parent | 589ea42181540923283e3d417f1a059de80d9f61 (diff) |
Remove another occurence of finding the last tag
-rwxr-xr-x | release | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -76,14 +76,12 @@ class Release(object): self.version = m.group(1) def check_version(self): - p = subprocess.Popen(['git', 'tag'], stdout=subprocess.PIPE) - tags = p.stdout.read().split('\n') - tags = [tag for tag in tags if tag != '' ] - tags.sort(key=lambda x: int(str.replace(x, 'v', ''))) - latest_tag = tags[-1] - if latest_tag.startswith('v'): - latest_tag = latest_tag[1:] - if latest_tag != self.version: + p = subprocess.Popen(['git', 'describe', '--tags', '--abbrev=0'], + stdout=subprocess.PIPE) + last_tag = p.stdout.read().strip('\n') + if last_tag.startswith('v'): + last_tag = last_tag[1:] + if last_tag != self.version: print 'Warning: Tag (%s) does not match version number (%s)' \ % (latest_tag, self.version) print 'You can use the --version option to force a specific version' |