@@ -803,10 +803,9 @@ def getbranches(rev=None, ret_rev=False):
803803 result = []
804804 refs = Git .getrefs ()
805805 for ref in refs :
806- m = re .match (r'^(.+)\s+(.+)$' , ref )
806+ m = re .match (r'^(.+)\s+refs\/(heads|remotes)\/ (.+)$' , ref )
807807 if m and (not rev or m .group (1 ).startswith (rev )):
808- if re .match (r'refs\/(heads|remotes)\/' , m .group (2 )): # exclude tags
809- result .append (m .group (1 ) if ret_rev else re .sub (r'refs\/(heads|remotes)\/' , '' , m .group (2 )))
808+ result .append (m .group (1 ) if ret_rev else m .group (3 ))
810809 return result
811810
812811 # Finds tags. Will match rev if specified
@@ -2164,9 +2163,9 @@ def sync(recursive=True, keep_refs=False, top=True):
21642163def list_ (detailed = False , prefix = '' , p_path = None , ignore = False ):
21652164 repo = Repo .fromrepo ()
21662165 revtags = repo .scm .gettags (repo .rev ) if repo .rev else []
2167- revstr = ('#' + repo .rev [:12 ]+ (', tags: ' + ', ' .join (revtags [0 :2 ]) if len (revtags ) else '' )) if repo .rev else ''
2166+ revstr = ('#' + repo .rev [:12 ] + (', tags: ' + ', ' .join (revtags [0 :2 ]) if len (revtags ) else '' )) if repo .rev else ''
21682167
2169- 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' ))
2168+ 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' ))
21702169
21712170 for i , lib in enumerate (sorted (repo .libs , key = lambda l : l .path )):
21722171 nprefix = (prefix [:- 3 ] + ('| ' if prefix [- 3 ] == '|' else ' ' )) if prefix else ''
@@ -2189,26 +2188,26 @@ def releases_(detailed=False, unstable=False, recursive=False, prefix='', p_path
21892188 repo = Repo .fromrepo ()
21902189 tags = repo .scm .gettags ()
21912190 revtags = repo .scm .gettags (repo .rev ) if repo .rev else [] # associated tags with current commit
2192- revstr = ('#' + repo .rev [:12 ]+ (', tags: ' + ', ' .join (revtags [0 :2 ]) if len (revtags ) else '' )) if repo .rev else ''
2191+ revstr = ('#' + repo .rev [:12 ] + (', tags: ' + ', ' .join (revtags [0 :2 ]) if len (revtags ) else '' )) if repo .rev else ''
21932192 regex_rels = regex_rels_all if unstable else regex_rels_official
21942193
21952194 # Generate list of tags
21962195 rels = []
21972196 for tag in tags :
21982197 if re .match (regex_rels , tag [1 ]):
2199- rels .append (tag [1 ] + " %s%s" % ('#' + tag [0 ] if detailed else "" , " <- current" if tag [1 ] in revtags else "" ))
2198+ rels .append (tag [1 ] + " %s%s" % ('#' + tag [0 ] if detailed else "" , " <- current" if tag [1 ] in revtags else "" ))
22002199
22012200 # Print header
2202- 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' ))
2201+ 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' ))
22032202
22042203 # Print list of tags
22052204 rprefix = (prefix [:- 3 ] + ('| ' if prefix [- 3 ] == '|' else ' ' )) if recursive and prefix else ''
22062205 rprefix += '| ' if recursive and len (repo .libs ) > 1 else ' '
22072206 if len (rels ):
22082207 for rel in rels :
2209- print rprefix + '* ' + rel
2208+ print rprefix + '* ' + rel
22102209 else :
2211- print rprefix + 'No release tags detected'
2210+ print rprefix + 'No release tags detected'
22122211
22132212 if recursive :
22142213 for i , lib in enumerate (sorted (repo .libs , key = lambda l : l .path )):
0 commit comments