- 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)
+ self.update(mode = MODE_FETCH)
+ currentVersion = git.describe()
+ # get sorted list of tag names with the same non-digit prefix and higher version number
+ tags = git.tag().split('\n')
+ tags = [t for t in tags if get_non_digit_prefix(t) == get_non_digit_prefix(currentVersion) and natural_sort_key(t) > natural_sort_key(currentVersion)]