|
103 | 103 |
|
104 | 104 | # mbed url is subset of hg. mbed doesn't support ssh transport
|
105 | 105 | regex_mbed_url = r'^(https?)://([\w\-\.]*mbed\.(co\.uk|org|com))/(users|teams)/([\w\-]{1,32})/(repos|code)/([\w\-]+)/?$'
|
106 |
| -regex_build_url = r'^(https?://([\w\-\.]*mbed\.(co\.uk|org|com))/(users|teams)/([\w\-]{1,32})/(repos|code)/([\w\-]+))/builds/?([\w\-]{12,40}|tip)?/?$' |
| 106 | +regex_build_url = r'^(https?://([\w\-\.]*mbed\.(co\.uk|org|com))/(users|teams)/([\w\-]{1,32})/(repos|code)/([\w\-]+))/builds/?([\w\-]{6,40}|tip)?/?$' |
107 | 107 |
|
108 | 108 | # base url for all mbed related repos (used as sort of index)
|
109 | 109 | mbed_base_url = 'https://github.com/ARMmbed'
|
@@ -783,6 +783,8 @@ def fromurl(cls, url, path=None):
|
783 | 783 | repo.path = os.path.abspath(path or os.path.join(os.getcwd(), repo.name))
|
784 | 784 | repo.url = formaturl(m_repo_url.group(1))
|
785 | 785 | repo.rev = m_repo_url.group(3)
|
| 786 | + if repo.rev and not re.match(r'^([a-fA-F0-9]{6,40})$', repo.rev): |
| 787 | + error('Invalid revision (%s)' % repo.rev, -1) |
786 | 788 | else:
|
787 | 789 | error('Invalid repository (%s)' % url.strip(), -1)
|
788 | 790 |
|
@@ -870,7 +872,7 @@ def pathtype(cls, path=None):
|
870 | 872 | def revtype(cls, rev, ret_rev=False):
|
871 | 873 | if rev is None or len(rev) == 0:
|
872 | 874 | return 'latest' + (' revision in the current branch' if ret_rev else '')
|
873 |
| - elif re.match(r'^([a-zA-Z0-9]{12,40})$', rev) or re.match(r'^([0-9]+)$', rev): |
| 875 | + elif re.match(r'^([a-fA-F0-9]{6,40})$', rev) or re.match(r'^([0-9]+)$', rev): |
874 | 876 | return 'rev' + (' #'+rev[0:12] if ret_rev else '')
|
875 | 877 | else:
|
876 | 878 | return 'branch' + (' '+rev if ret_rev else '')
|
|
0 commit comments