The imported Facebook code for locating Mercurial config files
differed from what Mercurial itself does. This commit modifies the
logic to match what Mercurial currently does.
As part of this, we added some crate dependencies. We could probably
avoid these dependencies if we want. But these crates are quite popular
and useful and I imagine we'll end up using them eventually.
We should probably add some test coverage of this code...
I believe this can just be .flatten().