hg
author Anton Shestakov <av6@dwimlabs.net>
Sun, 13 Sep 2015 21:01:34 +0800
changeset 26244 399e970e35c8
parent 21812 73e4a02e6d23
child 29172 2ea9c9aa6e60
permissions -rwxr-xr-x
coal: copy newer things from paper Basically, coal style in hgweb is intended to be functionally equivalent (just different in style) to paper, and does this by reusing almost all templates from paper (except header.tmpl, where it specifies a different css file). Looks like everybody forgot this and so many improvements to paper templates, that should've also made it into coal, were often only half-done there (usually thanks to template reuse). Let's fix this by bulk-copying missing things from paper/map and style-paper.css to coal/map and style-coal.css. There were many improvements to paper that didn't touch coal, and that makes it hard to untangle the code and split this patch into many, but here are some of the changes (paper-only), that now get into coal: 41c4bdd1d585 - hgweb: color line which is linked to in file source view f3393d458bf5 - hgweb: highlight line which is linked to at annotate view f2e4fdb3dd27 - hgweb: code selection without line numbers in file source view 5ec5097b4c0f - hgweb: add line wrapping switch to file source view bf661a03fddc - hgweb: use css margin instead of empty <p> before diffstat table It also fixes line anchor in annotateline template (#42 vs #l42).

#!/usr/bin/env python
#
# mercurial - scalable distributed SCM
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

import os
import sys

if os.environ.get('HGUNICODEPEDANTRY', False):
    reload(sys)
    sys.setdefaultencoding("undefined")


libdir = '@LIBDIR@'

if libdir != '@' 'LIBDIR' '@':
    if not os.path.isabs(libdir):
        libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                              libdir)
        libdir = os.path.abspath(libdir)
    sys.path.insert(0, libdir)

# enable importing on demand to reduce startup time
try:
    from mercurial import demandimport; demandimport.enable()
except ImportError:
    import sys
    sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
                     ' '.join(sys.path))
    sys.stderr.write("(check your install and PYTHONPATH)\n")
    sys.exit(-1)

import mercurial.util
import mercurial.dispatch

for fp in (sys.stdin, sys.stdout, sys.stderr):
    mercurial.util.setbinary(fp)

mercurial.dispatch.run()