Having hg.py instead of hg (on M$)

Patrick Mézard pmezard at gmail.com
Mon Nov 19 09:33:42 UTC 2007


dhruva a écrit :
> Hi,
>  I was wondering if we can have hg.py (with the extension on M$)
> instead of the current file with no extension during 'install'? The
> advantage is that the script can be made executable using the
> following set of commands in the command prompt (MS specific)
> 
> cmd> ASSOC .py=PythonScript
> cmd> FTYPE PythonScript=python.exe %1 %*
> cmd> hg help (works like an executable)

Strangely, the default action for .py on my system is to open them in an editor.
 
> The only problem I face is that 'hgk' needs to have a native 'hg'
> executable i.e., 'hg.exe' on M$.

Just add an hg.bat in your path with something like:
"""
@python c:\python251\scripts\hg %*
"""



More information about the Mercurial mailing list