#NEWLINE# def Execute( self , opt , args ) : #NEWLINE# #INDENT# if ( not args ) : #NEWLINE# #INDENT# self . Usage ( ) #NEWLINE# #UNINDENT# nb = args [ 0 ] #NEWLINE# if ( not git . check_ref_format ( ( 'heads/%s' % nb ) ) ) : #NEWLINE# #INDENT# print ( ( "error: '%s' is not a valid name" % nb ) , file = sys . stderr ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# err = [ ] #NEWLINE# projects = [ ] #NEWLINE# if ( not opt . all ) : #NEWLINE# #INDENT# projects = args [ 1 : ] #NEWLINE# if ( len ( projects ) < 1 ) : #NEWLINE# #INDENT# print ( 'error: at least one project must be specified' , file = sys . stderr ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# #UNINDENT# if self . gitc_manifest : #NEWLINE# #INDENT# all_projects = self . GetProjects ( projects , manifest = self . gitc_manifest , missing_ok = True ) #NEWLINE# for project in all_projects : #NEWLINE# #INDENT# if project . old_revision : #NEWLINE# #INDENT# project . already_synced = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# project . already_synced = False #NEWLINE# project . old_revision = project . revisionExpr #NEWLINE# #UNINDENT# project . revisionExpr = None #NEWLINE# #UNINDENT# gitc_utils . save_manifest ( self . gitc_manifest ) #NEWLINE# #UNINDENT# all_projects = self . GetProjects ( projects , missing_ok = bool ( self . gitc_manifest ) ) #NEWLINE# pm = Progress ( ( 'Starting %s' % nb ) , len ( all_projects ) ) #NEWLINE# for project in all_projects : #NEWLINE# #INDENT# pm . update ( ) #NEWLINE# if self . gitc_manifest : #NEWLINE# #INDENT# gitc_project = self . gitc_manifest . paths [ project . relpath ] #NEWLINE# if ( not gitc_project . already_synced ) : #NEWLINE# #INDENT# proj_localdir = os . path . join ( self . gitc_manifest . gitc_client_dir , project . relpath ) #NEWLINE# project . worktree = proj_localdir #NEWLINE# if ( not os . path . exists ( proj_localdir ) ) : #NEWLINE# #INDENT# os . makedirs ( proj_localdir ) #NEWLINE# #UNINDENT# project . Sync_NetworkHalf ( ) #NEWLINE# sync_buf = SyncBuffer ( self . manifest . manifestProject . config ) #NEWLINE# project . Sync_LocalHalf ( sync_buf ) #NEWLINE# project . revisionId = gitc_project . old_revision #NEWLINE# #UNINDENT# #UNINDENT# branch_merge = '' #NEWLINE# if IsId ( project . revisionExpr ) : #NEWLINE# #INDENT# if project . dest_branch : #NEWLINE# #INDENT# branch_merge = project . dest_branch #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# branch_merge = self . manifest . default . revisionExpr #NEWLINE# #UNINDENT# #UNINDENT# if ( not project . StartBranch ( nb , branch_merge = branch_merge ) ) : #NEWLINE# #INDENT# err . append ( project ) #NEWLINE# #UNINDENT# #UNINDENT# pm . end ( ) #NEWLINE# if opt : #NEWLINE# #INDENT# for p in err : #NEWLINE# #INDENT# print ( ( 'error: %s/: cannot start %s' % ( p . relpath , nb ) ) , file = sys . stderr ) #NEWLINE# #UNINDENT# sys . exit ( 1 )