@@ -2097,7 +2097,7 @@ def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=Fa
2097
2097
2098
2098
# Synch command
2099
2099
@subcommand ('sync' ,
2100
- help = 'Synchronize library references' ,
2100
+ help = 'Synchronize library references\n \n ' ,
2101
2101
description = (
2102
2102
"Synchronizes all library and dependency references (.lib files) in the\n "
2103
2103
"current program or library.\n "
@@ -2171,10 +2171,7 @@ def list_(detailed=False, prefix='', p_path=None, ignore=False):
2171
2171
print "%s (%s)" % (prefix + (relpath (p_path , repo .path ) if p_path else repo .name ), ((repo .url + ('#' + str (repo .rev )[:12 ] if repo .rev else '' ) if detailed else revstr ) or 'no revision' ))
2172
2172
2173
2173
for i , lib in enumerate (sorted (repo .libs , key = lambda l : l .path )):
2174
- if prefix :
2175
- nprefix = prefix [:- 3 ] + ('| ' if prefix [- 3 ] == '|' else ' ' )
2176
- else :
2177
- nprefix = ''
2174
+ nprefix = (prefix [:- 3 ] + ('| ' if prefix [- 3 ] == '|' else ' ' )) if prefix else ''
2178
2175
nprefix += '|- ' if i < len (repo .libs )- 1 else '`- '
2179
2176
2180
2177
if lib .check_repo (ignore ):
@@ -2184,34 +2181,45 @@ def list_(detailed=False, prefix='', p_path=None, ignore=False):
2184
2181
2185
2182
# Command status for cross-SCM status of repositories
2186
2183
@subcommand ('releases' ,
2187
- dict (name = ['-a' , '--all' ], dest = 'all_refs' , action = 'store_true' , help = 'Show all, e.g. release candidates, alpha , betas' ),
2188
- dict (name = ['-r' , '--recursive' ], action = 'store_true' , help = 'Show releases for all libraries and sub-libraries as well' ),
2189
- help = 'Shows release tags\n \n ' ,
2184
+ dict (name = ['-a' , '--all' ], dest = 'all_refs' , action = 'store_true' , help = 'Show all releases, including release candidates, alphas , betas, etc ' ),
2185
+ dict (name = ['-r' , '--recursive' ], action = 'store_true' , help = 'Show release tags for all libraries and sub-libraries as well' ),
2186
+ help = 'Show release tags' ,
2190
2187
description = (
2191
2188
"Show release tags for the current program or library." ))
2192
- def releases_ (all_refs = False , recursive = False ):
2189
+ def releases_ (all_refs = False , recursive = False , prefix = '' , p_path = None ):
2193
2190
repo = Repo .fromrepo ()
2194
2191
tags = repo .scm .gettags ()
2195
- revtags = repo .scm .gettags (repo .rev ) # associated tags with current commit
2192
+ revtags = repo .scm .gettags (repo .rev ) if repo .rev else [] # associated tags with current commit
2193
+ revstr = ('#' + repo .rev [:12 ]+ (', tags:' + ', ' .join (revtags [0 :2 ]) if len (revtags ) else '' )) if repo .rev else ''
2194
+ regex_rels = regex_rels_all if all_refs else regex_rels_official
2196
2195
2197
- action ("Releases in %s \" %s\" \n " % (repo .pathtype (repo .path ), repo .name ))
2198
- regex = regex_rels_all if all_refs else regex_rels_official
2196
+ # Generate list of tags
2199
2197
rels = []
2200
2198
for tag in tags :
2201
- if re .match (regex , tag [1 ]):
2199
+ if re .match (regex_rels , tag [1 ]):
2202
2200
rels .append (tag [1 ] + " %s%s" % (tag [0 ] if verbose else "" , " <- current" if tag [1 ] in revtags else "" ))
2203
2201
2202
+ # print header
2203
+ print "%s (%s)" % (prefix + (relpath (p_path , repo .path ) if p_path else repo .name ), ((repo .url + ('#' + str (repo .rev )[:12 ] if repo .rev else '' ) if verbose else revstr ) or 'no revision' ))
2204
+
2205
+ # print list of tags
2206
+ rprefix = (prefix [:- 3 ] + ('| ' if prefix [- 3 ] == '|' else ' ' )) if recursive and prefix else ''
2207
+ rprefix += '| ' if recursive and len (repo .libs )> 1 else ' '
2204
2208
if len (rels ):
2205
2209
for rel in rels :
2206
- log ( rel + " \n " )
2210
+ print rprefix + '* ' + rel
2207
2211
else :
2208
- log ("None\n " )
2209
- log ("\n " )
2212
+ print rprefix + 'No release tags detected'
2210
2213
2211
2214
if recursive :
2212
- for lib in repo .libs :
2213
- with cd (lib .path ):
2214
- releases_ (all_refs , recursive )
2215
+ for i , lib in enumerate (sorted (repo .libs , key = lambda l : l .path )):
2216
+ nprefix = (prefix [:- 3 ] + ('| ' if prefix [- 3 ] == '|' else ' ' )) if prefix else ''
2217
+ nprefix += '|- ' if i < len (repo .libs )- 1 else '`- '
2218
+
2219
+ if lib .check_repo ():
2220
+ with cd (lib .path ):
2221
+ releases_ (all_refs , recursive , nprefix , repo .path )
2222
+
2215
2223
2216
2224
# Command status for cross-SCM status of repositories
2217
2225
@subcommand ('status' ,
0 commit comments