changeset 23296:922fcfb02e77

patch.diffopts: allow a setting to be forced in plain mode Upcoming patches will add an option that will almost certainly break diff output parsers when enabled. Add support for forcing an option to something in plain mode, as a fallback. Options passed in via the CLI are not affected, though -- it is assumed that any script passing the option in explicitly knows what it is doing.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 12 Nov 2014 23:47:25 -0800
parents ac072c79bd9d
children d7abae94a7a0
files mercurial/patch.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Wed Nov 12 23:44:17 2014 -0800
+++ b/mercurial/patch.py	Wed Nov 12 23:47:25 2014 -0800
@@ -1564,6 +1564,8 @@
             v = opts.get(key)
             if v:
                 return v
+        if forceplain is not None and ui.plain():
+            return forceplain
         return getter(section, name or key, None, untrusted=untrusted)
 
     return mdiff.diffopts(