+ def checkVersions(self):
+ repo = git.Repo(self.folder)
+ # get tag for current commit, if any
+ commit = repo.commit(self.commit)
+ commitTag = filter(lambda t: t.commit == commit, repo.tags)
+ if not commitTag:
+ print "Version is not a tag"
+ return
+ currentVersion = str(commitTag[0])
+ # get sorted list of tag names
+ tags = map(str, repo.tags)
+ tags = filter(lambda t: natural_sort_key(t) > natural_sort_key(currentVersion), tags)
+ if not tags: return
+ tags.sort(key = natural_sort_key)
+ print "Versions newer than "+self.commit+" available:"
+ print tags
+