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

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Tue Feb 5 07:12:05 EST 2019


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

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 = {



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


More information about the Mercurial-devel mailing list