py3: add b'' prefixes in tests/test-ssh.t and tests/test-ssh-bundle1.t
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 20 May 2018 17:34:53 +0530
changeset 46282 e69628f361966858e13b199aa217a8bfe867cb22
parent 46281 44ef9bb7ccd90d468bc507562994b8cd4f4a9674
child 46283 666d90ace0bb4a8f9a03ff1476d7b3a7b6fe4d20
push id811
push usergszorc@mozilla.com
push dateWed, 23 May 2018 02:22:04 +0000
py3: add b'' prefixes in tests/test-ssh.t and tests/test-ssh-bundle1.t # skip-blame because just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D3630
tests/test-ssh-bundle1.t
tests/test-ssh.t
--- a/tests/test-ssh-bundle1.t
+++ b/tests/test-ssh-bundle1.t
@@ -439,21 +439,21 @@ stderr from remote commands should be pr
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd stderr-ordering
   $ cat >> localwrite.py << EOF
   > from mercurial import exchange, extensions
   > 
   > def wrappedpush(orig, repo, *args, **kwargs):
   >     res = orig(repo, *args, **kwargs)
-  >     repo.ui.write('local stdout\n')
+  >     repo.ui.write(b'local stdout\n')
   >     return res
   > 
   > def extsetup(ui):
-  >     extensions.wrapfunction(exchange, 'push', wrappedpush)
+  >     extensions.wrapfunction(exchange, b'push', wrappedpush)
   > EOF
 
   $ cat >> .hg/hgrc << EOF
   > [paths]
   > default-push = ssh://user@dummy/remote
   > [ui]
   > ssh = "$PYTHON" "$TESTDIR/dummyssh"
   > [extensions]
@@ -532,17 +532,17 @@ debug output
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
 
 remote hook failure is attributed to remote
 
   $ cat > $TESTTMP/failhook << EOF
   > def hook(ui, repo, **kwargs):
-  >     ui.write('hook failure!\n')
+  >     ui.write(b'hook failure!\n')
   >     ui.flush()
   >     return 1
   > EOF
 
   $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
 
   $ hg -q --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
   $ cd hookout
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -452,22 +452,22 @@ stderr from remote commands should be pr
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd stderr-ordering
   $ cat >> localwrite.py << EOF
   > from mercurial import exchange, extensions
   > 
   > def wrappedpush(orig, repo, *args, **kwargs):
   >     res = orig(repo, *args, **kwargs)
-  >     repo.ui.write('local stdout\n')
+  >     repo.ui.write(b'local stdout\n')
   >     repo.ui.flush()
   >     return res
   > 
   > def extsetup(ui):
-  >     extensions.wrapfunction(exchange, 'push', wrappedpush)
+  >     extensions.wrapfunction(exchange, b'push', wrappedpush)
   > EOF
 
   $ cat >> .hg/hgrc << EOF
   > [paths]
   > default-push = ssh://user@dummy/remote
   > [ui]
   > ssh = "$PYTHON" "$TESTDIR/dummyssh"
   > [extensions]
@@ -567,17 +567,17 @@ debug output
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   changegroup-in-remote hook: HG_BUNDLE2=1 HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
 
 remote hook failure is attributed to remote
 
   $ cat > $TESTTMP/failhook << EOF
   > def hook(ui, repo, **kwargs):
-  >     ui.write('hook failure!\n')
+  >     ui.write(b'hook failure!\n')
   >     ui.flush()
   >     return 1
   > EOF
 
   $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
 
   $ hg -q --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout
   $ cd hookout