Patchwork [4,of,9] patch.diffopts: add support for disabling config in plain mode

login
register
mail settings
Submitter Siddharth Agarwal
Date Nov. 13, 2014, 8:22 a.m.
Message ID <7448e2dc8b9141202eea.1415866932@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/6707/
State Accepted
Headers show

Comments

Siddharth Agarwal - Nov. 13, 2014, 8:22 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1415864152 28800
#      Wed Nov 12 23:35:52 2014 -0800
# Node ID 7448e2dc8b9141202eeafa310b74d3b2e3d1c882
# Parent  d03e758f55d169b24d7fa1ec6720ba4056917871
patch.diffopts: add support for disabling config in plain mode

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -1559,8 +1559,9 @@ 
     pass
 
 def diffopts(ui, opts=None, untrusted=False, section='diff'):
-    def get(key, name=None, getter=ui.configbool):
+    def get(key, name=None, getter=ui.configbool, forceplain=False):
         return ((opts and opts.get(key)) or
+                (ui.plain() and forceplain) or
                 getter(section, name or key, None, untrusted=untrusted))
     return mdiff.diffopts(
         text=opts and opts.get('text'),