[PATCH 2 of 3] test-hgrc: do not print ui.plain() flag at uisetup()

Yuya Nishihara yuya at tcha.org
Sun Mar 20 21:27:00 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1458511769 25200
#      Sun Mar 20 15:09:29 2016 -0700
# Node ID 306bcd1d5f7655ea1ab3f1bc87a48ce9d7a6c150
# Parent  83fd2e414307a5528a38ea39fcddd6250bd1a1f1
test-hgrc: do not print ui.plain() flag at uisetup()

This makes the test pass with chg. Since uisetup() is run per process,
"hg showconfig" does not always call uisetup().

diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t
--- a/tests/test-hgrc.t
+++ b/tests/test-hgrc.t
@@ -184,8 +184,12 @@ plain hgrc
 plain mode with exceptions
 
   $ cat > plain.py <<EOF
+  > from mercurial import commands, extensions
+  > def _config(orig, ui, repo, *values, **opts):
+  >     ui.write('plain: %r\n' % ui.plain())
+  >     return orig(ui, repo, *values, **opts)
   > def uisetup(ui):
-  >     ui.write('plain: %r\n' % ui.plain())
+  >     extensions.wrapcommand(commands.table, 'config', _config)
   > EOF
   $ echo "[extensions]" >> $HGRC
   $ echo "plain=./plain.py" >> $HGRC


More information about the Mercurial-devel mailing list