[issue2114] HGPLAIN should cancel diff.git=1

Jesse Glick bugs at mercurial.selenic.com
Fri Mar 26 13:34:57 UTC 2010


New submission from Jesse Glick <jesse.glick at oracle.com>:

If your ~/.hgrc contains

[diff]
git=1

then all commands will use Git diffs even if HGPLAIN is set. I find this
surprising since the intent of HGPLAIN is to cancel user settings which
could interfere with script output.

Of course, using --git is usually the fix for problems rather than a problem
itself, but still a change in behavior.

I assume the same applies to other options in the [diff] section.

Untested patch:

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -85,10 +85,9 @@
                       'traceback', 'verbose'):
                 if k in cfg['ui']:
                     del cfg['ui'][k]
-            for k, v in cfg.items('alias'):
-                del cfg['alias'][k]
-            for k, v in cfg.items('defaults'):
-                del cfg['defaults'][k]
+            for s in ('alias', 'defaults', 'diff'):
+                for k, v in cfg.items(s):
+                    del cfg[s][k]
 
         if trusted:
             self._tcfg.update(cfg)

----------
messages: 12173
nosy: jglick
priority: bug
status: unread
title: HGPLAIN should cancel diff.git=1
topic: 1.5, diff

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2114>
____________________________________________________


More information about the Mercurial-devel mailing list