mxcl/homebrew — pull request #15342 by mbcoguno (2012-10-07 16:03:08+00:00)
Title: mercurial: works with pythonbrew.

Someone use pythonbrew (or pythonz) to manage multiple pythons. The inreplace regexp can't replace the words well.
For example: `/Users/AAA/.pythonbrew/pythons/Python-2.7.3/Frameworks/Python.framework/Versions/2.7/bin/Resources/Python.app/Contents/MacOS/Python` become `pythons/Python-2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python`. This patch can solve this issue.

Also, if your python isn't from system nor homebrew, `--env=std` is required. (This is not the bug, just notice.)