# HG changeset patch # User Oleksandr Gavenko # Date 1703359171 -7200 # Node ID 921746b84574343acab9fcd905c06b085c1bfef3 # Parent 461eed8e7463dd4119fa23834b7b2c495f3a7453 Update hgweb to Python 3. diff -r 461eed8e7463 -r 921746b84574 deb/apache-register-hg.bash --- a/deb/apache-register-hg.bash Mon Jul 31 01:24:19 2023 +0300 +++ b/deb/apache-register-hg.bash Sat Dec 23 21:19:31 2023 +0200 @@ -9,14 +9,20 @@ chown user:user /srv/hg cat </srv/hg/hgweb.cgi -#!/usr/bin/env python +#!/usr/bin/env python3 # See also https://mercurial-scm.org/wiki/PublishingRepositories # Path to repo or hgweb config to serve (see 'hg help hgweb') -config = "/srv/hg/hgweb.config" +config = b"/srv/hg/hgweb.config" + +# Uncomment to send python tracebacks to the browser if an error occurs: +# import cgitb; cgitb.enable() -from mercurial import demandimport; demandimport.enable() +from mercurial import demandimport +demandimport.enable() + from mercurial.hgweb import hgweb, wsgicgi + application = hgweb(config) wsgicgi.launch(application) EOF