Changeset 359
- Timestamp:
- 27/07/15 09:14:32 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CMIP6dreq/manage/step1.py
r357 r359 18 18 tags = glob.glob( '../tags/*' ) 19 19 f1 = lambda x: map( int, string.split(x, '.' ) ) 20 tn = map( lambda x: tuple( f1(string.split(x,'/')[-1]) ), tags ) 21 tn.sort() 20 def f1( vs ): 21 bits = string.split(vs, '.' ) 22 estr = 'Version string should be "nn.nn" or "nn.[alpha|beta].nn": %s' % vs 23 assert len(bits) in [2,3], estr 24 if len( bits ) == 3: 25 assert bits[1] in ['alpha','beta'], estr 26 assert len(bits[0]) == 2 and len(bits[-1]) == 2, estr 27 bits[0] = int( bits[0] ) 28 bits[-1] = int( bits[-1] ) 29 return bits 30 31 def tcmp(t1,t2): 32 if len(t1) != len(t2): 33 if t1[0] == t2[0]: 34 return cmp( len(t1), len(t2) ) 35 else: 36 return cmp( t1[0], t2[0] ) 37 elif len(t1) == 2: 38 if t1[0] == t2[0]: 39 return cmp( t1[1], t2[1] ) 40 else: 41 return cmp( t1[0], t2[0] ) 42 elif len(t1) == 3: 43 if t1[0] == t2[0]: 44 if t1[1] == t2[1]: 45 return cmp( t1[2], t2[2] ) 46 else: 47 return cmp( t1[1], t2[1] ) 48 else: 49 return cmp( t1[0], t2[0] ) 50 22 51 thistag, thiscomment = sys.argv[1:] 23 52 thistn = tuple( f1( thistag ) ) 24 assert thistn > tn[-1], 'Requested tag not greater than last tag: %s' % str(tn[-1]) 53 if len(tags) > 0: 54 tn = map( lambda x: tuple( f1(string.split(x,'/')[-1]) ), tags ) 55 tn.sort(tcmp) 56 assert thistn > tn[-1], 'Requested tag not greater than last tag: %s' % str(tn[-1]) 25 57 26 58 oo = open( '../trunk/src/versionConfig.py', 'w' ) … … 36 68 cd ../trunk 37 69 svn ci -m "Updated setup for tag %(thistag)s" 38 svn copy %(svnBaseUrl) /trunk %(svnBaseUrl)/tags/%(thistag)s -m "%(thiscomment)s"70 svn copy %(svnBaseUrl)s/trunk %(svnBaseUrl)s/tags/%(thistag)s -m "%(thiscomment)s" 39 71 """ 40 72
Note: See TracChangeset
for help on using the changeset viewer.