hgweb.cgi
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Mon, 16 Oct 2006 20:38:04 -0300
changeset 3429 b19360aa21e9
parent 2506 d0db3462d568
child 3781 713e35dcc321
permissions -rw-r--r--
bundlerepo: avoid exception in __del__ when the bundle doesn't exist $ hg -R bundle://foo.hg abort: No such file or directory: foo.hg Exception exceptions.AttributeError: "'bundlerepository' object has no attribute 'bundlefile'" in <bound method bundlerepository.__del__ of <mercurial.bundlerepo.bundlerepository object at 0xa7ab9fac>> ignored
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
202
e875a0cf7f3a Call python via env in hgweb.cgi
mpm@selenic.com
parents: 159
diff changeset
     1
#!/usr/bin/env python
159
f9d8620ef469 Add example CGI script
mpm@selenic.com
parents:
diff changeset
     2
#
f9d8620ef469 Add example CGI script
mpm@selenic.com
parents:
diff changeset
     3
# An example CGI script to use hgweb, edit as necessary
f9d8620ef469 Add example CGI script
mpm@selenic.com
parents:
diff changeset
     4
f9d8620ef469 Add example CGI script
mpm@selenic.com
parents:
diff changeset
     5
import cgitb, os, sys
391
5f65a108a559 hgweb: pull cgitb into CGI script example, where it can easily be disabled
mpm@selenic.com
parents: 202
diff changeset
     6
cgitb.enable()
5f65a108a559 hgweb: pull cgitb into CGI script example, where it can easily be disabled
mpm@selenic.com
parents: 202
diff changeset
     7
159
f9d8620ef469 Add example CGI script
mpm@selenic.com
parents:
diff changeset
     8
# sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
2506
d0db3462d568 This patch make several WSGI related alterations.
Eric Hopper <hopper@omnifarious.org>
parents: 391
diff changeset
     9
from mercurial.hgweb.hgweb_mod import hgweb
d0db3462d568 This patch make several WSGI related alterations.
Eric Hopper <hopper@omnifarious.org>
parents: 391
diff changeset
    10
from mercurial.hgweb.request import wsgiapplication
d0db3462d568 This patch make several WSGI related alterations.
Eric Hopper <hopper@omnifarious.org>
parents: 391
diff changeset
    11
import mercurial.hgweb.wsgicgi as wsgicgi
159
f9d8620ef469 Add example CGI script
mpm@selenic.com
parents:
diff changeset
    12
2506
d0db3462d568 This patch make several WSGI related alterations.
Eric Hopper <hopper@omnifarious.org>
parents: 391
diff changeset
    13
def make_web_app():
d0db3462d568 This patch make several WSGI related alterations.
Eric Hopper <hopper@omnifarious.org>
parents: 391
diff changeset
    14
    return hgweb("/path/to/repo", "repository name")
d0db3462d568 This patch make several WSGI related alterations.
Eric Hopper <hopper@omnifarious.org>
parents: 391
diff changeset
    15
d0db3462d568 This patch make several WSGI related alterations.
Eric Hopper <hopper@omnifarious.org>
parents: 391
diff changeset
    16
wsgicgi.launch(wsgiapplication(make_web_app))