Patchwork D5833: diff: when looking for diff configs, support a configurable prefix

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2019, 12:12 p.m.
Message ID <b25fc02adf2f1d28bc1b151c94f85ac8@localhost.localdomain>
Download mbox | patch
Permalink /patch/38425/
State Not Applicable
Headers show

Comments

phabricator - Feb. 5, 2019, 12:12 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG78b270a55dc6: diff: when looking for diff configs, support a configurable prefix (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5833?vs=13760&id=13803

REVISION DETAIL
  https://phab.mercurial-scm.org/D5833

AFFECTED FILES
  mercurial/diffutil.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/diffutil.py b/mercurial/diffutil.py
--- a/mercurial/diffutil.py
+++ b/mercurial/diffutil.py
@@ -16,13 +16,15 @@ 
     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 @@ 
                 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 = {