contrib/hgweb.fcgi
author Pierre-Yves David <pierre-yves.david@octobus.net>
Sun, 21 May 2017 13:32:07 +0200
changeset 32390 f90419a90cc3
parent 15475 85cba926cb59
child 43659 99e231afc29c
permissions -rwxr-xr-x
perf: allow to clear the obsstore in 'perfvolatilesets' Loading the obsstore can become a large part of the time necessary to compute the important volatile set. We add a flag purging all known obsstore related data. For example, computing the 'bumped' set currently requires reading the full obsstore, so timing greatly differ with or without that flag: Without: ! bumped ! wall 0.005047 comb 0.000000 user 0.000000 sys 0.000000 (best of 446) With: ! bumped ! wall 0.512367 comb 0.510000 user 0.480000 sys 0.030000 (best of 15)

#!/usr/bin/env python
#
# An example FastCGI script for use with flup, edit as necessary

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/path/to/repo/or/config"

# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb
from flup.server.fcgi import WSGIServer
application = hgweb(config)
WSGIServer(application).run()