The mercurial package currently installs a hg script with a shebang of #!/usr/bin/python. Apple's Python (even on the latest beta of MacOS) doesn't support TLS 1.1+ and other modern crypto features.
Pior to my latest update of Homebrew (1.2.4) I had Python located, as indicated by brew --config, with a link to the latest Homebrew version: Python: /usr/local/bin ...