85
85
86
86
# mbed url is subset of hg. mbed doesn't support ssh transport
87
87
regex_mbed_url = r'^(https?)://([\w\-\.]*mbed\.(co\.uk|org|com))/(users|teams)/([\w\-]{1,32})/(repos|code)/([\w\-]+)/?$'
88
- regex_build_url = r'^(https?://([\w\-\.]*mbed\.(co\.uk|org|com))/(users|teams)/([\w\-]{1,32})/(repos|code)/([\w\-]+))/builds/?([\w\-]{1,32 })?/?$'
88
+ regex_build_url = r'^(https?://([\w\-\.]*mbed\.(co\.uk|org|com))/(users|teams)/([\w\-]{1,32})/(repos|code)/([\w\-]+))/builds/?([\w\-]{12,40 })?/?$'
89
89
90
90
# default mbed OS url
91
91
mbed_os_url = 'https://github.com/ARMmbed/mbed-os'
@@ -242,7 +242,6 @@ def init(path, url):
242
242
error ("Unable to write bldrc file in \" %s\" " % fl , 1 )
243
243
244
244
def clone (url , path = None , hash = None , depth = None , protocol = None ):
245
- # Deploys mbed SDK library build into program
246
245
m = Bld .isurl (url )
247
246
if not m :
248
247
return False
@@ -252,7 +251,6 @@ def clone(url, path=None, hash=None, depth=None, protocol=None):
252
251
253
252
try :
254
253
Bld .init (path , url + '/' + hash )
255
-
256
254
with cd (path ):
257
255
if not os .path .exists (arch_dir ):
258
256
action ("Downloading mbed library build \" %s\" (might take a minute)" % hash )
@@ -302,9 +300,8 @@ def pull(repo):
302
300
error ("mbed library builds do not support pushing" )
303
301
304
302
def update (repo , hash = None , clean = False ):
305
- if not hash :
306
- m = Bld .isurl (repo .url )
307
- hash = Hg .remoteid (m .group (1 ))
303
+ m = Bld .isurl (repo .url )
304
+ hash = Hg .remoteid (m .group (1 ), hash )
308
305
309
306
if not hash :
310
307
error ("Unable to fetch late mbed library revision" )
@@ -474,8 +471,8 @@ def gethash(repo):
474
471
def getbranch ():
475
472
return pquery ([hg_cmd , 'branch' ]).strip () or ""
476
473
477
- def remoteid (url ):
478
- return pquery ([hg_cmd , 'id' , '--id' , url ]).strip () or ""
474
+ def remoteid (url , hash = None ):
475
+ return pquery ([hg_cmd , 'id' , '--id' , url ] + ([ '-r' , hash ] if hash else []) ).strip () or ""
479
476
480
477
def ignores (repo ):
481
478
hook = 'ignore.local = .hg/hgignore'
@@ -902,7 +899,7 @@ def pathtype(cls, path=None):
902
899
def hashtype (cls , hash , ret_hash = False ):
903
900
if hash is None or len (hash ) == 0 :
904
901
return 'latest' + (' revision in the current branch' if ret_hash else '' )
905
- if re .match (r'^([a-zA-Z0-9]{12,40})$' , hash ):
902
+ elif re .match (r'^([a-zA-Z0-9]{12,40})$' , hash ) or re . match ( r'^([0-9]+ )$' , hash ):
906
903
return 'rev' + (' #' + hash if ret_hash else '' )
907
904
else :
908
905
return 'branch' + (' ' + hash if ret_hash else '' )
@@ -1158,7 +1155,7 @@ def post_action(self):
1158
1155
1159
1156
if len (missing ):
1160
1157
warning (
1161
- "mbed OS and tools in this program require Python modules that are not installed.\n "
1158
+ "The mbed build tools in this program require Python modules that are not installed.\n "
1162
1159
"This might prevent you from compiling your code or exporting to IDEs and other toolchains.\n "
1163
1160
"The missing Python modules are: %s\n "
1164
1161
"You can install all missing modules by opening a command prompt in \" %s\" and running \" pip install -r %s\" " % (', ' .join (missing ), mbed_os_path , fname ))
0 commit comments