From 1d55d7d8659279ed33c0b413f4bd4b2475364079 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Thu, 30 Sep 2010 09:38:04 +0000 Subject: Remove another occurence of finding the last tag --- diff --git a/release b/release index 7bf77eb..181cabc 100755 --- a/release +++ b/release @@ -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' -- cgit v0.9.1