2017-08-20 18:48:43 +02:00
|
|
|
from app import app
|
|
|
|
import re
|
|
|
|
|
|
|
|
version_re = re.compile('(?P<tag>.+)-(?P<commits>[0-9]+)-g(?P<hash>[0-9a-f]+)')
|
|
|
|
|
2017-08-29 14:46:32 +02:00
|
|
|
|
2017-08-20 18:48:43 +02:00
|
|
|
def url_for_version(ver):
|
|
|
|
match = version_re.match(ver)
|
|
|
|
if not match:
|
|
|
|
return app.config['REPO_URL']
|
2017-08-20 18:54:01 +02:00
|
|
|
return app.config['COMMIT_URL'].format(**match.groupdict())
|