       Enum.each(deps, fn %Mix.Dep{app: app, deps: other_deps} ->
         Enum.each(other_deps, fn
           %Mix.Dep{app: ^app} ->
-            Mix.raise "App #{app} lists itself as a dependency"
+            Mix.raise("App #{app} lists itself as a dependency")
+
           %Mix.Dep{app: other_app} ->
             :digraph.add_edge(graph, other_app, app)
         end)
       end)
 
       if apps = :digraph_utils.topsort(graph) do
-        Enum.map(apps, fn(app) ->
-          Enum.find(deps, fn(%Mix.Dep{app: other_app}) -> app == other_app end)
+        Enum.map(apps, fn app ->
+          Enum.find(deps, fn %Mix.Dep{app: other_app} -> app == other_app end)
         end)
       else
-        Mix.raise "Could not sort dependencies. There are cycles in the dependency graph"
+        Mix.raise("Could not sort dependencies. There are cycles in the dependency graph")
       end
     after
       :digraph.delete(graph)

    in_upper? = app in upper_breadths

    {acc, match} =
      Enum.map_reduce list, false, fn(other, match) ->
        %Mix.Dep{app: other_app, opts: other_opts} = other
        if other_app == app and other.top_level and dep.top_level do
          Mix.shell.error "warning: the dependency #{inspect dep.app} is " <>
                          "duplicated at the top level, please remove one " <>
                          "of them"
        end

        cond do
          app != other_app ->
            {other, match}
          in_upper? && other_opts[:override] ->
            {other |> with_matching_only(dep, in_upper?), true}
          converge?(other, dep) ->
            {other |> with_matching_only(dep, in_upper?)
                   |> with_matching_req(dep) |> merge_manager(dep, in_upper?), true}
          true ->
            tag = if in_upper?, do: :overridden, else: :diverged
            {%{other | status: {tag, dep}}, true}
        end
      end

    if match, do: acc
  end

    # Run remote converger and rerun Mix's converger with the new information.
    # Don't run the remote if deps didn't converge, if the remote is not
    # available or if none of the deps are handled by the remote.
    remote = Mix.RemoteConverger.get()
    diverged? = Enum.any?(deps, &Mix.Dep.diverged?/1)
    use_remote? = !!remote and Enum.any?(deps, &remote.remote?/1)

