view hgweb.cgi @ 29070:29a7d591ff42

ui: add new config option for help text width Before this patch, when printing help text using `hg help`, or `hg log -h`, the output will wrap at 78 chars even if the user has a bigger terminal width and there is no config option to change it, making the experience different from the commonly used `man` tool. This patch introduces a new config option `ui.textwidth`, which replaces the hardcoded number. It's set to 78 by default to maintain compatibility. When set to 0, `hg help` will behave more like `man`.
author Jun Wu <quark@fb.com>
date Wed, 04 May 2016 18:18:24 +0100
parents 4b0fc75f9403
children 47ef023d0165
line wrap: on
line source

#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# See also https://mercurial-scm.org/wiki/PublishingRepositories

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/path/to/repo/or/config"

# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)