Cannot install 1.9.3 from source or via pip. Running Windows 7 with Python 2.6. $ python .\setup.py install C:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated import sets running install running build running build_hgextindex Traceback (most recent call last): File ".\setup.py", line 441, in <module> **extra) File "C:\Python26\lib\distutils\core.py", line 152, in setup dist.run_commands() File "C:\Python26\lib\distutils\dist.py", line 975, in run_commands self.run_command(cmd) File "C:\Python26\lib\distutils\dist.py", line 995, in run_command cmd_obj.run() File "C:\Python26\lib\distutils\command\install.py", line 577, in run self.run_command('build') File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command self.distribution.run_command(command) File "C:\Python26\lib\distutils\dist.py", line 995, in run_command cmd_obj.run() File "C:\Python26\lib\distutils\command\build.py", line 134, in run self.run_command(cmd_name) File "C:\Python26\lib\distutils\cmd.py", line 333, in run_command self.distribution.run_command(command) File "C:\Python26\lib\distutils\dist.py", line 995, in run_command cmd_obj.run() File ".\setup.py", line 281, in run out, err = runcmd([sys.executable, '-c', code], env) NameError: global name 'env' is not defined
Using the mercurial repo, it installs fine. But using pip or the .zip on bitbucket (https://bitbucket.org/mirror/mercurial/get/1.9.3.zip) gives errors.
The download from PyPI is also broken. http://pypi.python.org/pypi/Mercurial
buildhgextindex in setup.py rely on 'env' as a global variable. That happens to be ok when .hg exists. I don't know what corner cases this code should support and if it is enough to run with {} as env or if something else should be defined. build_hgextindex is only run by default on windows where most people don't have a setup for building from source anyway. The impact of this is pretty low as build_hgextindex only is run by default on windows where most people don't have a setup for building from source anyway.
I guess we should just initialize env in the run method -- it's quite ugly to rely on a global variable that's so far away.
At least, env['SystemRoot'] is necessary to run any commands on Windows. So I think runcmd() should set 'SystemRoot', and buildhgextindex.run() should define env = {'LANGUAGE': 'C'} instead of using the global variable.
(partially?) fixed by http://www.selenic.com/hg/rev/b357a972d6cd
Fixed by http://selenic.com/repo/hg/rev/eb6c0d47c3d5 Yuya Nishihara <yuya@tcha.org> setup: set whole env for running hg even if .hg doesn't exist (issue3073) (please test the fix)
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:24 EDT --- This bug was previously known as _bug_ 3073 at http://mercurial.selenic.com/bts/issue3073