Admin/Mercurial/hgwebdir.cgi
author wenzelm
Sat Dec 16 12:28:46 2017 +0100 (20 months ago)
changeset 67210 f80bdbe76934
parent 40385 b70ef70733e8
permissions -rwxr-xr-x
tuned;
     1 #!/usr/bin/env python
     2 #
     3 # An example CGI script to export multiple hgweb repos, edit as necessary
     4 
     5 # adjust python path if not a system-wide install:
     6 import sys
     7 # using the hg installation provided by the system (AK, 3.3.2010)
     8 #sys.path.insert(0, "/home/isabelle-repository/repos/mercurial-www4/lib64/python2.5/site-packages")
     9 #sys.path.insert(0, "/usr/lib64/python2.5/site-packages")
    10 #sys.path.insert(0, "/home/isabelle-repository/repos/mercurial-1.3.1/lib64")
    11 #sys.path.insert(0, "/home/isabelle-repository/repos/testtool")
    12 
    13 
    14 # enable importing on demand to reduce startup time
    15 from mercurial import demandimport; demandimport.enable()
    16 
    17 # Uncomment to send python tracebacks to the browser if an error occurs:
    18 import cgitb
    19 cgitb.enable()
    20 
    21 # If you'd like to serve pages with UTF-8 instead of your default
    22 # locale charset, you can do so by uncommenting the following lines.
    23 # Note that this will cause your .hgrc files to be interpreted in
    24 # UTF-8 and all your repo files to be displayed using UTF-8.
    25 #
    26 import os
    27 os.environ["HGENCODING"] = "UTF-8"
    28 os.environ["HGRCPATH"] = "/home/isabelle-repository/repos/hgrc"
    29 
    30 from mercurial.hgweb.hgwebdir_mod import hgwebdir
    31 import mercurial.hgweb.wsgicgi as wsgicgi
    32 
    33 # The config file looks like this.  You can have paths to individual
    34 # repos, collections of repos in a directory tree, or both.
    35 #
    36 # [paths]
    37 # virtual/path = /real/path
    38 # virtual/path = /real/path
    39 #
    40 # [collections]
    41 # /prefix/to/strip/off = /root/of/tree/full/of/repos
    42 #
    43 # collections example: say directory tree /foo contains repos /foo/bar,
    44 # /foo/quux/baz.  Give this config section:
    45 #   [collections]
    46 #   /foo = /foo
    47 # Then repos will list as bar and quux/baz.
    48 #
    49 # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
    50 # or use a dictionary with entries like 'virtual/path': '/real/path'
    51 
    52 application = hgwebdir('/home/isabelle-repository/repos/hgweb.config')
    53 wsgicgi.launch(application)