2005-06-01 09:24:14 +04:00
|
|
|
#!/usr/bin/env python
|
2005-05-26 04:28:23 +04:00
|
|
|
#
|
|
|
|
# An example CGI script to use hgweb, edit as necessary
|
|
|
|
|
2007-08-25 18:31:37 +04:00
|
|
|
# adjust python path if not a system-wide install:
|
|
|
|
#import sys
|
|
|
|
#sys.path.insert(0, "/path/to/python/lib")
|
|
|
|
|
2007-08-18 13:37:08 +04:00
|
|
|
# enable importing on demand to reduce startup time
|
|
|
|
from mercurial import demandimport; demandimport.enable()
|
|
|
|
|
2008-02-12 19:07:45 +03:00
|
|
|
# Uncomment to send python tracebacks to the browser if an error occurs:
|
|
|
|
#import cgitb
|
|
|
|
#cgitb.enable()
|
2005-06-17 20:50:11 +04:00
|
|
|
|
2006-12-04 03:47:05 +03:00
|
|
|
# If you'd like to serve pages with UTF-8 instead of your default
|
|
|
|
# locale charset, you can do so by uncommenting the following lines.
|
|
|
|
# Note that this will cause your .hgrc files to be interpreted in
|
|
|
|
# UTF-8 and all your repo files to be displayed using UTF-8.
|
|
|
|
#
|
2006-12-11 16:30:50 +03:00
|
|
|
#import os
|
|
|
|
#os.environ["HGENCODING"] = "UTF-8"
|
|
|
|
|
|
|
|
from mercurial.hgweb.hgweb_mod import hgweb
|
|
|
|
import mercurial.hgweb.wsgicgi as wsgicgi
|
2006-12-04 03:47:05 +03:00
|
|
|
|
2008-02-18 21:20:22 +03:00
|
|
|
application = hgweb("/path/to/repo", "repository name")
|
|
|
|
wsgicgi.launch(application)
|