     # left out as accumulator and upper breadth to help catch
     # inconsistencies across environment, specially regarding
     # the :only option. They are filtered again later.
-    {main, upper} = Mix.Dep.Loader.partition_by_env(deps, opts)
-    apps = Enum.map(main, &(&1.app))
+    current = Enum.map(deps, &(&1.app))
+    {main, only} = Mix.Dep.Loader.partition_by_env(deps, opts)
 
     # Run converger for all dependencies, except remote
     # dependencies. Since the remote converger may be
     # lazily loaded, we need to check for it on every
     # iteration.
     {deps, rest, lock} =
-      all(main, upper, upper, apps, callback, acc, lock, fn dep ->
+      all(main, only, [], current, callback, acc, lock, fn dep ->
         if (converger = Mix.RemoteConverger.get) &&
            converger.remote?(dep) do
           {:loaded, dep}

    end
  end

  defp converge?(%Mix.Dep{scm: scm1, opts: opts1}, %Mix.Dep{scm: scm2, opts: opts2}) do
    scm1 == scm2 and mix_equal?(opts1, opts2) and scm1.equal?(opts1, opts2)
  end

      # valid.
      lock_for_converger = lock || Mix.Dep.Lock.read

      all(main, [], [], Enum.map(main, &(&1.app)), callback, rest, lock, fn dep ->
        cond do
          cached = deps[dep.app] ->
            {:loaded, cached}
