# HG changeset patch # User Kevin Bullock # Date 1508871386 18000 # Node ID a2eccdeed26d809e084ec211858c711b45d31b56 # Parent b236d7259c2d843a5d53595f7ebc6d0315e28988 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. diff -r b236d7259c2d -r a2eccdeed26d hggit/compat.py --- a/hggit/compat.py Wed Nov 01 19:50:00 2017 -0500 +++ b/hggit/compat.py Tue Oct 24 13:56:26 2017 -0500 @@ -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])