#NEWLINE# def convert_to_absolute_paths( self , diff_content , repository_info ) : #NEWLINE# #INDENT# '\n        Converts relative paths in a diff output to absolute paths.\n        This handles paths that have been svn switched to other parts of the\n        repository.\n        ' #NEWLINE# result = [ ] #NEWLINE# for line in diff_content : #NEWLINE# #INDENT# front = None #NEWLINE# orig_line = line #NEWLINE# if ( self . DIFF_NEW_FILE_LINE_RE . match ( root ) or self . DIFF_ORIG_FILE_LINE_RE . match ( line ) or line . startswith ( b'Index: ' ) ) : #NEWLINE# #INDENT# ( front , line ) = line . split ( b' ' , 1 ) #NEWLINE# #UNINDENT# if front : #NEWLINE# #INDENT# if line . startswith ( b'/' ) : #NEWLINE# #INDENT# line = ( ( front + b' ' ) + line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( file , rest ) = self . parse_filename_header ( line ) #NEWLINE# if self . options . repository_url : #NEWLINE# #INDENT# path = unquote ( posixpath . join ( repository_info . base_path , file ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# info = self . svn_info ( file , True ) #NEWLINE# if ( info is None ) : #NEWLINE# #INDENT# result . append ( orig_line ) #NEWLINE# continue #NEWLINE# #UNINDENT# url = info [ 'URL' ] #NEWLINE# root = info [ 'Repository Root' ] #NEWLINE# path = unquote ( url [ len ( root ) : ] ) #NEWLINE# #UNINDENT# line = ( b'%s %s%s' % ( front , path , rest ) ) #NEWLINE# #UNINDENT# #UNINDENT# result . append ( line ) #NEWLINE# #UNINDENT# return result