changeset 30806:e2796f193f06

patch: add similarity config knob in experimental section This config knob will control whether or not to show the similarity calculation in the diff output: diff --git a/README.md b/foo.md similarity index 88% rename from README.md rename to foo.md --- a/README.md +++ b/foo.md
author Sean Farley <sean@farley.io>
date Mon, 09 Jan 2017 10:51:44 -0800
parents 0ae287eb6a4f
children 6381a6dbc325
files mercurial/mdiff.py mercurial/patch.py
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mdiff.py	Sat Jan 07 20:47:57 2017 -0800
+++ b/mercurial/mdiff.py	Mon Jan 09 10:51:44 2017 -0800
@@ -57,6 +57,7 @@
         'ignorewsamount': False,
         'ignoreblanklines': False,
         'upgrade': False,
+        'showsimilarity': False,
         }
 
     def __init__(self, **opts):
--- a/mercurial/patch.py	Sat Jan 07 20:47:57 2017 -0800
+++ b/mercurial/patch.py	Mon Jan 09 10:51:44 2017 -0800
@@ -2169,6 +2169,11 @@
     if git:
         buildopts['git'] = get('git')
 
+        # since this is in the experimental section, we need to call
+        # ui.configbool directory
+        buildopts['showsimilarity'] = ui.configbool('experimental',
+                                                    'extendedheader.similarity')
+
         # need to inspect the ui object instead of using get() since we want to
         # test for an int
         hconf = ui.config('experimental', 'extendedheader.index')