class Molinillo::Resolver::Resolution

def state_index_for_unwind

Returns:
  • (Integer) - The index to which the resolution should unwind in the
def state_index_for_unwind
  current_requirement = requirement
  existing_requirement = requirement_for_existing_name(name)
  until current_requirement.nil?
    current_state = find_state_for(current_requirement)
    return states.index(current_state) if state_any?(current_state)
    current_requirement = parent_of(current_requirement)
  end
  until existing_requirement.nil?
    existing_state = find_state_for(existing_requirement)
    return states.index(existing_state) if state_any?(existing_state)
    existing_requirement = parent_of(existing_requirement)
  end
  -1
end