That's the reason I stopped using Homebrew and plenty of other comments have said the same thing. Maybe it's changed recently, but last time I used it (about a year ago), dependencies were not cleanly resolved in every case.
I used to use it for things like local installs of server-side stuff (e.g. language runtime, database server, cache server, etc) but I've moved to using vagrant (and in turn Debian, so Apt) for those things.
For dev tools such as Mercurial, Git, Autotools, etc there are first/third party .pkg installers available.
You can say that again. Homebrew's dependency management is a fucking joke, to the point that it might as well not exist.