def get_file_from_filediff(context, filediff, interfilediff):
 interdiffset = None
 key = (u'_diff_files_%s_%s' % (filediff.diffset.id, filediff.id))
 if interfilediff:
  key += (u'_%s' % interfilediff.id)
  interdiffset = interfilediff.diffset
 if (key in context):
  files = context[key]
 else:
  assert (u'user' in context)
  request = context.get(u'request', None)
  files = get_diff_files(filediff.diffset, filediff, interdiffset, interfilediff=interfilediff, request=request)
  populate_diff_chunks(files, get_enable_highlighting(context[u'user']), request=request)
  context[key] = files
 if (not files):
  return None
 assert (len(files) == 1)
 return files[0]

def get_file_from_filediff ( context , filediff , interfilediff ) : interdiffset = None key = ( u'_diff_files_%s_%s' % ( filediff . diffset . id , filediff . id ) ) if interfilediff : key += ( u'_%s' % interfilediff . id ) interdiffset = interfilediff . diffset if ( key in context ) : files = context [ key ] else : assert ( u'user' in context ) request = context . get ( u'request' , None ) files = get_diff_files ( filediff . diffset , filediff , interdiffset , interfilediff = interfilediff , request = request ) populate_diff_chunks ( files , get_enable_highlighting ( context [ u'user' ] ) , request = request ) context [ key ] = files if ( not files ) : return None assert ( len ( files ) == 1 ) return files [ 0 ]
return the files that corresponds to the filediff/interfilediff .