Skip to content
Snippets Groups Projects
Commit a2eccdeed26d authored by Kevin Bullock's avatar Kevin Bullock
Browse files

config: provide a central place to define and access defaults

Provides a place to register the defaults for all config options in one
place, and a helper to read them. This will let us eliminate deprecation
warnings on hg 4.4 (in a future change) while remaining compatible with
older versions.
parent b236d7259c2d
No related branches found
No related tags found
No related merge requests found
......@@ -60,3 +60,13 @@
if len(refs) == 0:
return None, set([])
return refs, set(server_capabilities)
CONFIG_DEFAULTS = {
}
def config(ui, subtype, section, item):
if subtype == 'string':
subtype = ''
getconfig = getattr(ui, 'config' + subtype)
return getconfig(section, item, CONFIG_DEFAULTS[section][item])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment