test-hgrc: do not print ui.plain() flag at uisetup()
authorYuya Nishihara <yuya@tcha.org>
Sun, 20 Mar 2016 15:09:29 -0700
changeset 28611 6aa17f86d9f0
parent 28610 3aa50c9d89a0
child 28612 6fb1d3c936d2
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().
tests/test-hgrc.t
--- a/tests/test-hgrc.t	Sun Mar 20 12:25:46 2016 -0700
+++ b/tests/test-hgrc.t	Sun Mar 20 15:09:29 2016 -0700
@@ -184,8 +184,12 @@
 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