def get_original_file(filediff, request, encoding_list):
 data = ''
 if (not filediff.is_new):
  repository = filediff.diffset.repository
  data = repository.get_file(filediff.source_file, filediff.source_revision, base_commit_id=filediff.diffset.base_commit_id, request=request)
  (encoding, data) = convert_to_unicode(data, encoding_list)
  data = convert_line_endings(data)
  data = data.encode(encoding)
 if (filediff.parent_diff and ((not filediff.extra_data) or (not filediff.extra_data.get(u'parent_moved', False)))):
  data = patch(filediff.parent_diff, data, filediff.source_file, request)
 return data

def get_original_file ( filediff , request , encoding_list ) : data = '' if ( not filediff . is_new ) : repository = filediff . diffset . repository data = repository . get_file ( filediff . source_file , filediff . source_revision , base_commit_id = filediff . diffset . base_commit_id , request = request ) ( encoding , data ) = convert_to_unicode ( data , encoding_list ) data = convert_line_endings ( data ) data = data . encode ( encoding ) if ( filediff . parent_diff and ( ( not filediff . extra_data ) or ( not filediff . extra_data . get ( u'parent_moved' , False ) ) ) ) : data = patch ( filediff . parent_diff , data , filediff . source_file , request ) return data
get a file either from the cache or the scm .