view hgweb.cgi @ 39286:3c4b2e880273

log: respect graphshorten on terminal nodes (collapsing o-~ to just o~) Internally we have a custom template that's inspired by ones that we have seen in the community. Normally, this looks something like: o 0834ec17 spectral tip | crecord: support x to toggle single, X to toggle a range o ee932990 spectral @ | filemerge: allow specifying $hgeditor as merge-tools.X.executable @ 66f04611 matt_harbison | cext: fix truncation warnings in revlog on Windows o 42cc76d0 matt_harbison | cext: fix revlog compiler error on Windows ~ o bd63ada7 stable boris | phases: drop dead code in `newheads` ~ With graphshorten on, and the descriptions of the public nodes hidden, it looks like this, note that the commits right before the ~ are still "full height": o 0834ec17 spectral tip | crecord: support x to toggle single, X to toggle a range o ee932990 spectral @ | filemerge: allow specifying $hgeditor as merge-tools.X.executable @ 66f04611 matt_harbison o 42cc76d0 matt_harbison | ~ o bd63ada7 stable boris | ~ This patch makes them look like this, removing the | but keeping the ~: o 0834ec17 spectral tip | crecord: support x to toggle single, X to toggle a range o ee932990 spectral @ | filemerge: allow specifying $hgeditor as merge-tools.X.executable @ 66f04611 matt_harbison o 42cc76d0 matt_harbison ~ o bd63ada7 stable boris ~ This originally removed the ~s entirely, but this was determined to be too much information loss and potentially confusing. This would have looked like the following (note that the last commit is on a different branch than all of the ones above it, and they are *not* linearly related): o 0834ec17 spectral tip | crecord: support x to toggle single, X to toggle a range o ee932990 spectral @ | filemerge: allow specifying $hgeditor as merge-tools.X.executable @ 66f04611 matt_harbison o 42cc76d0 matt_harbison o bd63ada7 stable boris Differential Revision: https://phab.mercurial-scm.org/D4363
author Kyle Lippincott <spectral@google.com>
date Thu, 23 Aug 2018 13:33:19 -0700
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)