@@ -2181,26 +2181,27 @@ def list_(detailed=False, prefix='', p_path=None, ignore=False):
2181
2181
2182
2182
# Command status for cross-SCM status of repositories
2183
2183
@subcommand ('releases' ,
2184
- dict (name = ['-a' , '--all' ], dest = 'all_refs' , action = 'store_true' , help = 'Show all releases, including release candidates, alphas, betas, etc' ),
2184
+ dict (name = ['-a' , '--all' ], dest = 'detailed' , action = 'store_true' , help = 'Show revision hashes' ),
2185
+ dict (name = ['-u' , '--unstable' ], dest = 'unstable' , action = 'store_true' , help = 'Show unstable releases well, e.g. release candidates, alphas, betas, etc' ),
2185
2186
dict (name = ['-r' , '--recursive' ], action = 'store_true' , help = 'Show release tags for all libraries and sub-libraries as well' ),
2186
2187
help = 'Show release tags' ,
2187
2188
description = (
2188
2189
"Show release tags for the current program or library." ))
2189
- def releases_ (all_refs = False , recursive = False , prefix = '' , p_path = None ):
2190
+ def releases_ (detailed = False , unstable = False , recursive = False , prefix = '' , p_path = None ):
2190
2191
repo = Repo .fromrepo ()
2191
2192
tags = repo .scm .gettags ()
2192
2193
revtags = repo .scm .gettags (repo .rev ) if repo .rev else [] # associated tags with current commit
2193
2194
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
2195
+ regex_rels = regex_rels_all if unstable else regex_rels_official
2195
2196
2196
2197
# Generate list of tags
2197
2198
rels = []
2198
2199
for tag in tags :
2199
2200
if re .match (regex_rels , tag [1 ]):
2200
- rels .append (tag [1 ] + " %s%s" % (tag [0 ] if verbose else "" , " <- current" if tag [1 ] in revtags else "" ))
2201
+ rels .append (tag [1 ] + " %s%s" % (tag [0 ] if detailed else "" , " <- current" if tag [1 ] in revtags else "" ))
2201
2202
2202
2203
# 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
+ 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' ))
2204
2205
2205
2206
# print list of tags
2206
2207
rprefix = (prefix [:- 3 ] + ('| ' if prefix [- 3 ] == '|' else ' ' )) if recursive and prefix else ''
@@ -2218,7 +2219,7 @@ def releases_(all_refs=False, recursive=False, prefix='', p_path=None):
2218
2219
2219
2220
if lib .check_repo ():
2220
2221
with cd (lib .path ):
2221
- releases_ (all_refs , recursive , nprefix , repo .path )
2222
+ releases_ (detailed , unstable , recursive , nprefix , repo .path )
2222
2223
2223
2224
2224
2225
# Command status for cross-SCM status of repositories
0 commit comments