Mercurial 5.0 rc + Python 3.7 + Apache 2.4.39

Pulkit Goyal 7895pulkit at gmail.com
Thu May 2 08:25:33 EDT 2019


On Thu, May 2, 2019 at 7:14 AM Edgar Anjensen Landazuri Sánchez <
edgar.landazuri.sanchez at gmail.com> wrote:

> Hello,
> I've been trying to setup a mercurial repository for a couple of days now.
> After struggling with the different versions that are needed I ended up
> going after the state of the art approach.
> Here is my setup:
>
>    1. Mercurial 5.0 rc
>    2. Python 3.7.3
>    3. mod_wsig 4.6.5 (installed via pip)
>    4. Apache 2.4.39 VC15
>
> I installed the components in the following order:
>
>    1. Python 3.7.3
>    2. mod_wsig 4.6.5 using pip install
>    3. Mercurial 5.0rc
>       1. Downloaded the Mercurial 5.0rc source files
>       2. Downloaded/installed the 2019 Build tools for C
>       3. Build the Mercurial using python setup.py build
>       4. Install the Mercurial using python setup.py install
>    4. Installed the apache server 2.4.39
>
> My httpd.config file (sections)
> -------------------------------------------------------------
> # Loading the wsgi_mod
> LoadFile "c:/program files/python37/python37.dll"
> LoadModule wsgi_module "c:/program
> files/python37/lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
> WSGIPythonHome "c:/program files/python37"
>
> # Adding the Directory
> WSGIScriptAlias /hg "c:/hg_server/hgweb.wsgi"
> <Directory "c:/hg_server">
> AllowOverride None
> Options None
> Require all granted
> </Directory>
> -------------------------------------------------------------
>
>
> My hgweb.wsgi file
> -------------------------------------------------------------
> # An example WSGI for use with mod_wsgi, edit as necessary
> # See http://mercurial.selenic.com/wiki/modwsgi for more information
>
> # Path to repo or hgweb config to serve (see 'hg help hgweb')
> config = "c:/hg_server/hgweb.config"
>
> # Uncomment and adjust if Mercurial is not installed system-wide:
> # import sys; sys.path.insert(0, "c:/program files/python37/lib/")
>
> # Uncomment to send python tracebacks to the browser if an error occurs:
> # import cgitb; cgitb.enable()
>
> # enable demandloading to reduce startup time
> from mercurial import demandimport; demandimport.enable()
>
> from mercurial.hgweb import hgweb
> application = hgweb(config)
>

You need to pass bytes here. By default on python 3, config variable will
be of type str which is unicodes. Mercurial works with bytes internally.

We should also document all these things. I will try to have a look.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20190502/0c22e2e1/attachment.html>


More information about the Mercurial-devel mailing list