#NEWLINE# def _process( command , chdir = False ) : #NEWLINE# #INDENT# '\n    Helper method for running processes related to git.\n    ' #NEWLINE# if chdir : #NEWLINE# #INDENT# log . debug ( 'Changing directories to %s' , chdir ) #NEWLINE# cwd = os . getcwd ( ) #NEWLINE# os . chdir ( chdir ) #NEWLINE# #UNINDENT# log . debug ( 'Running %s' , command ) #NEWLINE# process = subprocess . Popen ( command , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . PIPE , shell = False ) #NEWLINE# return_code = process . wait ( ) #NEWLINE# if chdir : #NEWLINE# #INDENT# os . chdir ( cwd ) #NEWLINE# #UNINDENT# if ( return_code > 0 ) : #NEWLINE# #INDENT# log . error ( 'STDERR output: %s' , process . stderr . read ( ) ) #NEWLINE# #UNINDENT# return return_code