#NEWLINE# def _reverse( self ) : #NEWLINE# #INDENT# " reverse patch direction (this doesn't touch filenames) " #NEWLINE# for p in self . items : #NEWLINE# #INDENT# for h in p . hunks : #NEWLINE# #INDENT# ( h . startsrc , h . starttgt ) = ( h . starttgt , h . startsrc ) #NEWLINE# ( h . linessrc , h . linestgt ) = ( h . linestgt , h . linessrc ) #NEWLINE# for ( i , line ) in enumerate ( h . text ) : #NEWLINE# #INDENT# if ( line [ 0 : 1 ] == b'+' ) : #NEWLINE# #INDENT# h . text [ i ] = ( b'-' + h [ 1 : ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( line [ 0 : 1 ] == b'-' ) : #NEWLINE# #INDENT# h . text [ i ] = ( b'+' + line [ 1 : ] )