mercurial/patch.py
changeset 29948 e40343ce9c4c
parent 29900 50f2966f86ca
child 30078 173bdb502503
--- a/mercurial/patch.py	Tue Sep 13 22:57:57 2016 -0400
+++ b/mercurial/patch.py	Tue Aug 30 15:55:07 2016 -0400
@@ -2144,7 +2144,14 @@
     def get(key, name=None, getter=ui.configbool, forceplain=None):
         if opts:
             v = opts.get(key)
-            if v:
+            # diffopts flags are either None-default (which is passed
+            # through unchanged, so we can identify unset values), or
+            # some other falsey default (eg --unified, which defaults
+            # to an empty string). We only want to override the config
+            # entries from hgrc with command line values if they
+            # appear to have been set, which is any truthy value,
+            # True, or False.
+            if v or isinstance(v, bool):
                 return v
         if forceplain is not None and ui.plain():
             return forceplain