Move config from .hgrc to hgweb script

This commit is contained in:
René Pfeuffer
2018-11-20 17:23:07 +01:00
parent 01f45aaf8c
commit a1f7939ac0
3 changed files with 14 additions and 254 deletions

View File

@@ -31,12 +31,21 @@
import os
from mercurial import demandimport
from mercurial import demandimport, ui as uimod, hg
from mercurial.hgweb import hgweb, wsgicgi
repositoryPath = os.environ['SCM_REPOSITORY_PATH']
demandimport.enable()
application = hgweb(repositoryPath)
u = uimod.ui()
u.setconfig('web', 'push_ssl', 'false')
u.setconfig('web', 'allow_read', '*')
u.setconfig('web', 'allow_push', '*')
u.setconfig('hooks', 'changegroup.scm', 'python:scmhooks.callback')
u.setconfig('hooks', 'pretxnchangegroup.scm', 'python:scmhooks.callback')
r = hg.repository(u, os.environ['SCM_REPOSITORY_PATH'])
application = hgweb(r)
wsgicgi.launch(application)