##// END OF EJS Templates
util: better handle '-' in version string (issue5302)...
Gregory Szorc -
r29613:616cbcb5 stable
parent child Browse files
Show More
@@ -396,10 +396,26 b' def versiontuple(v=None, n=4):'
396 (3, 6, None)
396 (3, 6, None)
397 >>> versiontuple(v, 4)
397 >>> versiontuple(v, 4)
398 (3, 6, None, None)
398 (3, 6, None, None)
399
400 >>> v = '3.9-rc'
401 >>> versiontuple(v, 2)
402 (3, 9)
403 >>> versiontuple(v, 3)
404 (3, 9, None)
405 >>> versiontuple(v, 4)
406 (3, 9, None, 'rc')
407
408 >>> v = '3.9-rc+2-02a8fea4289b'
409 >>> versiontuple(v, 2)
410 (3, 9)
411 >>> versiontuple(v, 3)
412 (3, 9, None)
413 >>> versiontuple(v, 4)
414 (3, 9, None, 'rc+2-02a8fea4289b')
399 """
415 """
400 if not v:
416 if not v:
401 v = version()
417 v = version()
402 parts = v.split('+', 1)
418 parts = remod.split('[\+-]', v, 1)
403 if len(parts) == 1:
419 if len(parts) == 1:
404 vparts, extra = parts[0], None
420 vparts, extra = parts[0], None
405 else:
421 else:
General Comments 0
You need to be logged in to leave comments. Login now