class Bundler::PubGrub::VersionSolver

def propagate(initial_package)

def propagate(initial_package)
  changed = [initial_package]
  while package = changed.shift
    @incompatibilities[package].reverse_each do |incompatibility|
      result = propagate_incompatibility(incompatibility)
      if result == :conflict
        root_cause = resolve_conflict(incompatibility)
        changed.clear
        changed << propagate_incompatibility(root_cause)
      elsif result # should be a Package
        changed << result
      end
    end
    changed.uniq!
  end
end