dmitry@294: # An example WSGI (use with mod_wsgi) script to export multiple hgweb repos dmitry@294: dmitry@294: # adjust python path if not a system-wide install: dmitry@294: #import sys dmitry@294: #sys.path.insert(0, "/path/to/python/lib") dmitry@294: dmitry@294: # enable demandloading to reduce startup time dmitry@294: from mercurial import demandimport; demandimport.enable() dmitry@294: from mercurial.hgweb.hgwebdir_mod import hgwebdir dmitry@294: dmitry@294: # If you'd like to serve pages with UTF-8 instead of your default dmitry@294: # locale charset, you can do so by uncommenting the following lines. dmitry@294: # Note that this will cause your .hgrc files to be interpreted in dmitry@294: # UTF-8 and all your repo files to be displayed using UTF-8. dmitry@294: # dmitry@294: #import os dmitry@294: #os.environ["HGENCODING"] = "UTF-8" dmitry@294: dmitry@294: # The config file looks like this. You can have paths to individual dmitry@294: # repos, collections of repos in a directory tree, or both. dmitry@294: # dmitry@294: # [paths] dmitry@294: # virtual/path1 = /real/path1 dmitry@294: # virtual/path2 = /real/path2 dmitry@294: # virtual/root = /real/root/* dmitry@294: # / = /real/root2/* dmitry@294: # dmitry@294: # paths example: dmitry@294: # dmitry@294: # * First two lines mount one repository into one virtual path, like dmitry@294: # '/real/path1' into 'virtual/path1'. dmitry@294: # dmitry@294: # * The third entry tells every mercurial repository found in dmitry@294: # '/real/root', recursively, should be mounted in 'virtual/root'. This dmitry@294: # format is preferred over the [collections] one, using absolute paths dmitry@294: # as configuration keys is not supported on every platform (including dmitry@294: # Windows). dmitry@294: # dmitry@294: # * The last entry is a special case mounting all repositories in dmitry@294: # '/real/root2' in the root of the virtual directory. dmitry@294: # dmitry@294: # collections example: say directory tree /foo contains repos /foo/bar, dmitry@294: # /foo/quux/baz. Give this config section: dmitry@294: # [collections] dmitry@294: # /foo = /foo dmitry@294: # Then repos will list as bar and quux/baz. dmitry@294: # dmitry@294: # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples dmitry@294: # or use a dictionary with entries like 'virtual/path': '/real/path' dmitry@294: dmitry@294: application = hgwebdir('hgweb.config')