Compute dependency graph and upload layers in the right order when pushing
Merge pull request #1780 from shin-/1218-push-dependencies

Respect dependency graph when pushing a repository