#NEWLINE# def _ParseProject( self , node , parent = None , **extra_proj_attrs ) : #NEWLINE# #INDENT# '\n    reads a <project> element from the manifest file\n    ' #NEWLINE# name = self . _reqatt ( node , 'name' ) #NEWLINE# if parent : #NEWLINE# #INDENT# name = self . _JoinName ( parent . name , name ) #NEWLINE# #UNINDENT# remote = self . _get_remote ( node ) #NEWLINE# if ( remote is None ) : #NEWLINE# #INDENT# remote = self . _default . remote #NEWLINE# #UNINDENT# if ( remote is None ) : #NEWLINE# #INDENT# raise ManifestParseError ( ( 'no remote for project %s within %s' % ( name , self . manifestFile ) ) ) #NEWLINE# #UNINDENT# revisionExpr = ( node . getAttribute ( 'revision' ) or remote . revision ) #NEWLINE# if ( not revisionExpr ) : #NEWLINE# #INDENT# revisionExpr = self . _default . revisionExpr #NEWLINE# #UNINDENT# if ( not revisionExpr ) : #NEWLINE# #INDENT# raise ManifestParseError ( ( 'no revision for project %s within %s' % ( name , self . manifestFile ) ) ) #NEWLINE# #UNINDENT# path = node . getAttribute ( 'path' ) #NEWLINE# if ( not path ) : #NEWLINE# #INDENT# path = name #NEWLINE# #UNINDENT# if path . startswith ( '/' ) : #NEWLINE# #INDENT# raise ManifestParseError ( ( 'project %s path cannot be absolute in %s' % ( remote , self . manifestFile ) ) ) #NEWLINE# #UNINDENT# rebase = node . getAttribute ( 'rebase' ) #NEWLINE# if ( not rebase ) : #NEWLINE# #INDENT# rebase = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# rebase = ( rebase . lower ( ) in ( 'yes' , 'true' , '1' ) ) #NEWLINE# #UNINDENT# sync_c = node . getAttribute ( 'sync-c' ) #NEWLINE# if ( not sync_c ) : #NEWLINE# #INDENT# sync_c = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sync_c = ( sync_c . lower ( ) in ( 'yes' , 'true' , '1' ) ) #NEWLINE# #UNINDENT# sync_s = node . getAttribute ( 'sync-s' ) #NEWLINE# if ( not sync_s ) : #NEWLINE# #INDENT# sync_s = self . _default . sync_s #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sync_s = ( sync_s . lower ( ) in ( 'yes' , 'true' , '1' ) ) #NEWLINE# #UNINDENT# clone_depth = node . getAttribute ( 'clone-depth' ) #NEWLINE# if clone_depth : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# clone_depth = int ( clone_depth ) #NEWLINE# if ( clone_depth <= 0 ) : #NEWLINE# #INDENT# raise ValueError ( ) #NEWLINE# #UNINDENT# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise ManifestParseError ( ( 'invalid clone-depth %s in %s' % ( clone_depth , self . manifestFile ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# dest_branch = ( node . getAttribute ( 'dest-branch' ) or self . _default . destBranchExpr ) #NEWLINE# upstream = node . getAttribute ( 'upstream' ) #NEWLINE# groups = '' #NEWLINE# if node . hasAttribute ( 'groups' ) : #NEWLINE# #INDENT# groups = node . getAttribute ( 'groups' ) #NEWLINE# #UNINDENT# groups = self . _ParseGroups ( groups ) #NEWLINE# if ( parent is None ) : #NEWLINE# #INDENT# ( relpath , worktree , gitdir , objdir ) = self . GetProjectPaths ( name , path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( relpath , worktree , gitdir , objdir ) = self . GetSubprojectPaths ( parent , name , path ) #NEWLINE# #UNINDENT# default_groups = [ 'all' , ( 'name:%s' % name ) , ( 'path:%s' % relpath ) ] #NEWLINE# groups . extend ( set ( default_groups ) . difference ( groups ) ) #NEWLINE# if ( self . IsMirror and node . hasAttribute ( 'force-path' ) ) : #NEWLINE# #INDENT# if ( node . getAttribute ( 'force-path' ) . lower ( ) in ( 'yes' , 'true' , '1' ) ) : #NEWLINE# #INDENT# gitdir = os . path . join ( self . topdir , ( '%s.git' % path ) ) #NEWLINE# #UNINDENT# #UNINDENT# project = Project ( manifest = self , name = name , remote = remote . ToRemoteSpec ( name ) , gitdir = gitdir , objdir = objdir , worktree = worktree , relpath = relpath , revisionExpr = revisionExpr , revisionId = None , rebase = rebase , groups = groups , sync_c = sync_c , sync_s = sync_s , clone_depth = clone_depth , upstream = upstream , parent = parent , dest_branch = dest_branch , ** extra_proj_attrs ) #NEWLINE# for n in node . childNodes : #NEWLINE# #INDENT# if ( n . nodeName == 'copyfile' ) : #NEWLINE# #INDENT# self . _ParseCopyFile ( project , n ) #NEWLINE# #UNINDENT# if ( n . nodeName == 'linkfile' ) : #NEWLINE# #INDENT# self . _ParseLinkFile ( project , n ) #NEWLINE# #UNINDENT# if ( n . nodeName == 'annotation' ) : #NEWLINE# #INDENT# self . _ParseAnnotation ( project , n ) #NEWLINE# #UNINDENT# if ( n . nodeName == 'project' ) : #NEWLINE# #INDENT# project . subprojects . append ( self . _ParseProject ( n , parent = project ) ) #NEWLINE# #UNINDENT# #UNINDENT# return project