def make_revisit_location_translations(query_metadata_table):
    """Return a dict mapping location revisits to the location being revisited, for rewriting."""
    location_translations = dict()

    for location, _ in query_metadata_table.registered_locations:
        location_being_revisited = query_metadata_table.get_revisit_origin(location)
        if location_being_revisited != location:
            location_translations[location] = location_being_revisited

    return location_translations