# HG changeset patch # User Kyle Lippincott # Date 2019-01-31 22:29:24 # Node ID 78b270a55dc60ac111c704619ce75b82a4662185 # Parent 901ebc81ffb30d5e3ff4e8403d6d0691ce9371c5 diff: when looking for diff configs, support a configurable prefix In a future commit, I want to make it possible to have the diff options pulled from (as an example) `commands.commit.interactive.ignorews`; previously we only supported this for customizable sections (so this would have needed a `commit-interactive` section and been named `commit-interactive.ignorews`, which felt a bit weird. Differential Revision: https://phab.mercurial-scm.org/D5833 diff --git a/mercurial/diffutil.py b/mercurial/diffutil.py --- a/mercurial/diffutil.py +++ b/mercurial/diffutil.py @@ -16,13 +16,15 @@ from . import ( pycompat, ) -def diffallopts(ui, opts=None, untrusted=False, section='diff'): +def diffallopts(ui, opts=None, untrusted=False, section='diff', + configprefix=''): '''return diffopts with all features supported and parsed''' return difffeatureopts(ui, opts=opts, untrusted=untrusted, section=section, - git=True, whitespace=True, formatchanging=True) + git=True, whitespace=True, formatchanging=True, + configprefix=configprefix) def difffeatureopts(ui, opts=None, untrusted=False, section='diff', git=False, - whitespace=False, formatchanging=False): + whitespace=False, formatchanging=False, configprefix=''): '''return diffopts with only opted-in features parsed Features: @@ -45,7 +47,8 @@ def difffeatureopts(ui, opts=None, untru return v if forceplain is not None and ui.plain(): return forceplain - return getter(section, name or key, untrusted=untrusted) + return getter(section, configprefix + (name or key), + untrusted=untrusted) # core options, expected to be understood by every diff parser buildopts = {