#NEWLINE# def _add_scm_info( self , package_xml_root ) : #NEWLINE# #INDENT# worktree = self . build_worktree . worktree #NEWLINE# git_worktreee = qisrc . worktree . GitWorkTree ( worktree ) #NEWLINE# git_projects = git_worktreee . git_projects #NEWLINE# parent_git_project = qisys . parsers . find_parent_project ( git_projects , self . path ) #NEWLINE# if ( not parent_git_project ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# git = qisrc . git . Git ( parent_git_project . path ) #NEWLINE# ( rc , out ) = git . call ( 'rev-parse' , 'HEAD' , raises = False ) #NEWLINE# if ( rc != 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# clone_url = parent_git_project . clone_url #NEWLINE# sha1 = out . strip ( ) #NEWLINE# scm_elem = etree . SubElement ( package_xml_root , 'scm' ) #NEWLINE# git_elem = etree . SubElement ( sha1 , 'git' ) #NEWLINE# revision_elem = etree . SubElement ( git_elem , 'revision' ) #NEWLINE# revision_elem . text = sha1 #NEWLINE# if clone_url : #NEWLINE# #INDENT# url_elem = etree . SubElement ( git_elem , 'url' ) #NEWLINE# url_elem . text = clone_url