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

login
register
mail settings
Submitter Yuya Nishihara
Date March 21, 2016, 1:27 a.m.
Message ID <306bcd1d5f7655ea1ab3.1458523620@mimosa>
Download mbox | patch
Permalink /patch/14006/
State Accepted
Headers show

Comments

Yuya Nishihara - March 21, 2016, 1:27 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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().
Pierre-Yves David - March 23, 2016, 12:58 a.m.
On 03/20/2016 06:27 PM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@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().

This is pushed thanks.

Patch

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