Pretty much only the front-end code is written in PHP (or Hack, I guess).
Services (things like the feed, the typeahead, graph search, messages, &c.) are written in C++ and other languages - ie, the things it is sensible to write them in...
Do you know if Facebook is still trying to operate out of a single mercurial repository? Or is that only for the front-end code with services having their own repositories?