Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>John Weldons answer is correct, I just wanted to provide a little detail on the wide array of possibilities you may also be interested in.</p> <p>hgwebdir is just a <a href="http://wsgi.org/wsgi/" rel="nofollow noreferrer">wsgi</a> application, so you can run it like any other wsgi application using <a href="http://mercurial.selenic.com/wiki/modwsgi" rel="nofollow noreferrer">mod_wsgi</a> in apache2. mod_wsgi will also perform better than cgi because the overhead of loading the python interpreter is done once rather than for each request.</p> <p>Also by virtue of being a wsgi application means you can also wrap it up in <a href="http://wsgi.org/wsgi/Middleware_and_Utilities" rel="nofollow noreferrer">middleware</a>, or <a href="http://pythonpaste.org/modules/urlmap.html" rel="nofollow noreferrer">hang it off another url</a> of a bigger website etc...</p> <p>For example, say you are using <a href="http://trac.edgewall.org/" rel="nofollow noreferrer">trac</a>(another wsgi app) and you want to share the authorization scheme between trac and hgwebdir, this can be accomplished by putting them both behind authorization middleware like <a href="http://static.repoze.org/whodocs/" rel="nofollow noreferrer">repoze.who</a> for example. </p> <p>Finally, since <a href="http://pythonpaste.org" rel="nofollow noreferrer">python paste</a> makes building web apps out of smaller pieces, I wrote this code snippet to start hgwebdir via paste.</p> <pre><code>""" Wsgi wrapper of hgweb that is paste compatible """ import os from mercurial import demandimport demandimport.enable() from mercurial.hgweb.hgwebdir_mod import hgwebdir CONFIG_FILE_KEY = "hgwebdir.config" def hgweb_paste(global_config, **local_conf): """ looking for a config file setting in global or local """ cfg = global_config cfg.update(local_conf) config_file = cfg.get(CONFIG_FILE_KEY) if config_file and os.path.exists(config_file): return hgwebdir(config_file) else: raise KeyError, "%s not set or %s does not exist" % (CONFIG_FILE_KEY,config_file) </code></pre> <p>And the corresponding config file part to load it...</p> <pre><code>[server:main] use = egg:Paste#http host = 0.0.0.0 port = 6543 [app:main] use = egg:hg.paste#hgweb hgwebdir.config = %(here)s/hg.config </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload