#NEWLINE# def get_branch_choices( self , repo , filter = ( 'published' , 'unpublished' ) ) : #NEWLINE# #INDENT# lines = self . legit_lines ( [ 'branches' ] , cwd = repo ) #NEWLINE# ( branches , choices ) = ( [ ] , [ ] ) #NEWLINE# for l in lines : #NEWLINE# #INDENT# if ( not l ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# current = l [ 0 : 2 ] #NEWLINE# ( name , pub ) = l [ 2 : ] . split ( None , 1 ) #NEWLINE# pub = pub . strip ( ' \t()' ) #NEWLINE# if ( not ( pub in filter ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# choices . append ( [ ( '%s%s' % ( current , name . strip ( ) ) ) , ( '  %s' % pub ) ] ) #NEWLINE# branches . append ( name ) #NEWLINE# #UNINDENT# return ( branches , choices )