#NEWLINE# def _do_git( self ) : #NEWLINE# #INDENT# print ( 'Checking for Uncommitted Changes' ) #NEWLINE# ( out , err , res ) = shell . exec_cmd ( [ 'git' , '--no-pager' , 'diff' ] ) #NEWLINE# if ( len ( out ) > 0 ) : #NEWLINE# #INDENT# self . _do_error ( 'There are uncommitted changes. See `git status`.' ) #NEWLINE# #UNINDENT# print ( 'Checking for Untracked Files' ) #NEWLINE# ( out , err , res ) = shell . exec_cmd ( [ 'git' , 'status' ] ) #NEWLINE# if re . match ( 'Untracked files' , str ( out ) ) : #NEWLINE# #INDENT# self . _do_error ( 'There are untracked files.  See `git status`.' ) #NEWLINE# #UNINDENT# print ( 'Checking for Duplicate Git Tag' ) #NEWLINE# ( out , err , res ) = shell . exec_cmd ( [ 'git' , 'tag' ] ) #NEWLINE# for ver in str ( out ) . split ( '\n' ) : #NEWLINE# #INDENT# if ( ver == VERSION ) : #NEWLINE# #INDENT# self . _do_error ( ( 'Tag %s already exists' % VERSION ) ) #NEWLINE# #UNINDENT# #UNINDENT# print ( 'Tagging Git Release' ) #NEWLINE# ( out , err , res ) = shell . exec_cmd ( [ 'git' , 'tag' , '-a' , '-m' , VERSION , VERSION ] ) #NEWLINE# if ( err > 0 ) : #NEWLINE# #INDENT# self . _do_error ( 'Unable to tag release with git.' )