return None
@staticmethod
+ def _build_legacy_tag(format, version):
+ """
+ Legacy tags (prior to 0.5.5) dropped epochs and didn't honor the '~'
+
+ >>> DebianGitRepository._build_legacy_tag('upstream/%(version)s', '1:2.0~3')
+ 'upstream/2.0.3'
+ """
+ if ':' in version: # strip of any epochs
+ version = version.split(':', 1)[1]
+ version = version.replace('~', '.')
+ return format % dict(version=version)
+
+ @staticmethod
def version_to_tag(format, version):
"""Generate a tag from a given format and a version
out, ret = self.__git_getoutput('tag', [ '-l', tag ])
return [ False, True ][len(out)]
- def _build_legacy_tag(self, format, version):
- """legacy version numbering"""
- if ':' in version: # strip of any epochs
- version = version.split(':', 1)[1]
- version = version.replace('~', '.')
- return format % dict(version=version)
-
def find_tag(self, commit, pattern=None):
"""
Find the closest tag to a given commit