[PATCH] ui: ignores logtemplate and style when HGPLAIN is set

Yuya Nishihara yuya at tcha.org
Tue Mar 2 09:15:19 CST 2010


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1267542725 -32400
# Branch stable
# Node ID 98a30581fa5e89824af7eff9001c7063dc0f001e
# Parent  70dea42c9406f6289e14c71543f42f6d135a59e1
ui: ignores logtemplate and style when HGPLAIN is set

HGPLAIN should suppress them because they change Mercurial's default output.

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -81,6 +81,7 @@ class ui(object):
 
         if self.plain():
             for k in ('debug', 'fallbackencoding', 'quiet', 'slash',
+                      'logtemplate', 'style',
                       'traceback', 'verbose'):
                 if k in cfg['ui']:
                     del cfg['ui'][k]
diff --git a/tests/test-hgrc b/tests/test-hgrc
--- a/tests/test-hgrc
+++ b/tests/test-hgrc
@@ -32,8 +32,10 @@ p=`pwd`
 echo "[ui]" > $HGRCPATH
 echo "debug=true" >> $HGRCPATH
 echo "fallbackencoding=ASCII" >> $HGRCPATH
+echo "logtemplate={node}" >> $HGRCPATH
 echo "quiet=true" >> $HGRCPATH
 echo "slash=true" >> $HGRCPATH
+echo "style=~/.hgstyle" >> $HGRCPATH
 echo "traceback=true" >> $HGRCPATH
 echo "verbose=true" >> $HGRCPATH
 echo "[defaults]" >> $HGRCPATH
diff --git a/tests/test-hgrc.out b/tests/test-hgrc.out
--- a/tests/test-hgrc.out
+++ b/tests/test-hgrc.out
@@ -11,14 +11,16 @@ foo.bar=a\nb\nc\nde\nfg
 foo.baz=bif cb
 hg: config error at $HGRCPATH:1: cannot include /no-such-file (No such file or directory)
 % customized hgrc
-.../.hgrc:11: alias.log=log -g
-.../.hgrc:9: defaults.identify=-n
+.../.hgrc:13: alias.log=log -g
+.../.hgrc:11: defaults.identify=-n
 .../.hgrc:2: ui.debug=true
 .../.hgrc:3: ui.fallbackencoding=ASCII
-.../.hgrc:4: ui.quiet=true
-.../.hgrc:5: ui.slash=true
-.../.hgrc:6: ui.traceback=true
-.../.hgrc:7: ui.verbose=true
+.../.hgrc:4: ui.logtemplate={node}
+.../.hgrc:5: ui.quiet=true
+.../.hgrc:6: ui.slash=true
+.../.hgrc:7: ui.style=~/.hgstyle
+.../.hgrc:8: ui.traceback=true
+.../.hgrc:9: ui.verbose=true
 % plain hgrc
 none: ui.traceback=True
 none: ui.verbose=False


More information about the Mercurial-devel mailing list