##// END OF EJS Templates
hgweb: plug followlines action in annotate view...
hgweb: plug followlines action in annotate view Add the followlines.js script and corresponding parameters as data attribute on <tbody class="sourcelines"> element. Extend CSS rules so that they also match the DOM structure of annotate view. As previously, only address paper and gitweb styles (other styles do not have followlines at all).

File last commit:

r32989:03608e8d default
r32994:1c97df5e default
Show More
configitems.py
47 lines | 1.2 KiB | text/x-python | PythonLexer
configitems: add a basic class to hold config item information...
r32983 # configitems.py - centralized declaration of configuration option
#
# Copyright 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
configitems: introduce a central registry for config option...
r32984 from . import (
error,
)
configitems: add a basic class to hold config item information...
r32983 class configitem(object):
"""represent a known config item
:section: the official config section where to find this item,
:name: the official name within the section,
:default: default value for this item,
"""
def __init__(self, section, name, default=None):
self.section = section
self.name = name
self.default = default
configitems: introduce a central registry for config option...
r32984
coreitems = {}
def coreconfigitem(*args, **kwargs):
item = configitem(*args, **kwargs)
section = coreitems.setdefault(item.section, {})
if item.name in section:
msg = "duplicated config item registration for '%s.%s'"
raise error.ProgrammingError(msg % (item.section, item.name))
section[item.name] = item
configitems: register 'ui.quiet' as first example...
r32986
# Registering actual config items
configitems: register 'patch.fuzz' as first example for 'configint'...
r32988 coreconfigitem('patch', 'fuzz',
default=2,
)
configitems: register 'ui.clonebundleprefers' as example for 'configlist'...
r32989 coreconfigitem('ui', 'clonebundleprefers',
default=[],
)
configitems: register 'ui.quiet' as first example...
r32986 coreconfigitem('ui', 'quiet',
default=False,
)