#NEWLINE# def apply_patch_for_empty_files( self , patch , p_num , revert = False ) : #NEWLINE# #INDENT# 'Returns True if any empty files in the patch are applied.\n\n        If there are no empty files in the patch or if an error occurs while\n        applying the patch, we return False.\n        ' #NEWLINE# patched_empty_files = False #NEWLINE# if revert : #NEWLINE# #INDENT# added_files = self . DELETED_FILES_RE . findall ( patch ) #NEWLINE# deleted_files = self . ADDED_FILES_RE . findall ( patch ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# added_files = self . ADDED_FILES_RE . findall ( patch ) #NEWLINE# deleted_files = self . DELETED_FILES_RE . findall ( patch ) #NEWLINE# #UNINDENT# if added_files : #NEWLINE# #INDENT# added_files = self . _strip_p_num_slashes ( added_files , int ( p_num ) ) #NEWLINE# make_empty_files ( added_files ) #NEWLINE# result = self . _run_svn ( ( [ 'add' , '--force' ] + added_files ) , ignore_errors = True , none_on_ignored_error = True ) #NEWLINE# if ( result is None ) : #NEWLINE# #INDENT# logging . error ( 'Unable to execute "svn add" on: %s' , ', ' . join ( added_files ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# patched_empty_files = True #NEWLINE# #UNINDENT# #UNINDENT# if p_num : #NEWLINE# #INDENT# deleted_files = self . _strip_p_num_slashes ( deleted_files , int ( p_num ) ) #NEWLINE# result = self . _run_svn ( ( [ 'delete' , '--force' ] + deleted_files ) , ignore_errors = True , none_on_ignored_error = True ) #NEWLINE# if ( result is None ) : #NEWLINE# #INDENT# logging . error ( 'Unable to execute "svn delete" on: %s' , ', ' . join ( deleted_files ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# patched_empty_files = True #NEWLINE# #UNINDENT# #UNINDENT# return patched_empty_files