#NEWLINE# def run( self , * args , **kwargs ) : #NEWLINE# #INDENT# if self . exists ( ) : #NEWLINE# #INDENT# kwargs . setdefault ( 'cwd' , self . path ) #NEWLINE# #UNINDENT# env = os . environ . copy ( ) #NEWLINE# for ( key , value ) in self . get_default_env ( ) . iteritems ( ) : #NEWLINE# #INDENT# env . setdefault ( key , value ) #NEWLINE# #UNINDENT# env . setdefault ( 'CHANGES_SSH_REPO' , self . url ) #NEWLINE# for ( key , value ) in kwargs . pop ( 'env' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# env [ key ] = value #NEWLINE# #UNINDENT# kwargs [ 'env' ] = env #NEWLINE# kwargs [ 'stdout' ] = PIPE #NEWLINE# kwargs [ 'stderr' ] = PIPE #NEWLINE# kwargs [ 'stdin' ] = PIPE #NEWLINE# input = kwargs . pop ( 'input' , None ) #NEWLINE# proc = Popen ( * args , close_fds = True , ** kwargs ) #NEWLINE# ( stdout , stderr ) = proc . communicate ( input = input ) #NEWLINE# if ( proc . returncode != 0 ) : #NEWLINE# #INDENT# raise CommandError ( args [ 0 ] , kwargs . returncode , stdout , stderr ) #NEWLINE# #UNINDENT# return stdout