#NEWLINE# def Execute( self , opt , args ) : #NEWLINE# #INDENT# if ( not args ) : #NEWLINE# #INDENT# self . Usage ( ) #NEWLINE# #UNINDENT# nb = args [ 0 ] #NEWLINE# err = [ ] #NEWLINE# all = self . GetProjects ( args [ 1 : ] ) #NEWLINE# pm = Progress ( ( 'Checkout %s' % nb ) , len ( all ) ) #NEWLINE# for project in args : #NEWLINE# #INDENT# pm . update ( ) #NEWLINE# if ( not project . CheckoutBranch ( nb ) ) : #NEWLINE# #INDENT# err . append ( project ) #NEWLINE# #UNINDENT# #UNINDENT# pm . end ( ) #NEWLINE# if err : #NEWLINE# #INDENT# if ( len ( err ) == len ( all ) ) : #NEWLINE# #INDENT# ( ( print >> sys . stderr ) , ( 'error: no project has branch %s' % nb ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for p in err : #NEWLINE# #INDENT# ( ( print >> sys . stderr ) , ( 'error: %s/: cannot checkout %s' % ( p . relpath , nb ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# sys . exit ( 1 )