Bug 1157302 - [mozbase] Ignore unrecognized version strings when generating changelogs in versioninfo.py, DONTBUILD, r=armenzg

--HG--
extra : rebase_source : e1038d7ea1ac7cc9c23b570103e9aae97e04346e
This commit is contained in:
Andrew Halberstadt 2015-04-22 11:49:34 -04:00
Родитель 998752462f
Коммит fe95342cec
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -43,9 +43,15 @@ def changelog(args):
plus_version = None
for line in diff.splitlines():
if line.startswith('-PACKAGE_VERSION'):
minus_version = StrictVersion(line.split()[-1].strip('"\''))
try:
minus_version = StrictVersion(line.split()[-1].strip('"\''))
except ValueError:
pass
elif line.startswith('+PACKAGE_VERSION'):
plus_version = StrictVersion(line.split()[-1].strip('"\''))
try:
plus_version = StrictVersion(line.split()[-1].strip('"\''))
except ValueError:
break
# make sure the change isn't a backout
if not minus_version or plus_version > minus_version:
@ -54,6 +60,7 @@ def changelog(args):
if StrictVersion(v) == plus_version:
return rev
print("Could not find %s revision for version %s." % (args.module, v or 'latest'))
sys.exit(1)