tests/test-ssh-proto-unbundle.t
author Luke Granger-Brown <hg@lukegb.com>
Mon, 14 Mar 2022 14:10:41 +0000
branchstable
changeset 48962 59be65b7cdfd
parent 48646 77f8f8caf859
child 48876 42d2b31cee0b
permissions -rw-r--r--
rust-hg-core: use correct type for libc hostname buffer The type of libc::c_char is u8 on aarch64 rather than i8, which causes the use of a specifically-typed constant to fail. Differential Revision: https://phab.mercurial-scm.org/D12373
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46880
8bf21b3869cd persistent-nodemap: disable it unconditionally for test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
     1
persistent-nodemap is not enabled by default. It is not relevant for this test so disable it.
8bf21b3869cd persistent-nodemap: disable it unconditionally for test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
     2
8bf21b3869cd persistent-nodemap: disable it unconditionally for test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
     3
  $ cat << EOF >> $HGRCPATH
8bf21b3869cd persistent-nodemap: disable it unconditionally for test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
     4
  > [format]
8bf21b3869cd persistent-nodemap: disable it unconditionally for test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
     5
  > use-persistent-nodemap = no
8bf21b3869cd persistent-nodemap: disable it unconditionally for test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
     6
  > EOF
8bf21b3869cd persistent-nodemap: disable it unconditionally for test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
     7
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
  $ debugwireproto() {
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
  >   commands=`cat -`
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
  >   echo 'testing ssh1'
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  >   tip=`hg log -r tip -T '{node}'`
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
  >   echo "${commands}" | hg --verbose debugwireproto --localssh --noreadstderr
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
  >   if [ -n "$1" ]; then
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
  >       hg --config extensions.strip= strip --no-backup -r "all() - ::${tip}"
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
  >   fi
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
  > }
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
Generate some bundle files
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
  $ hg init repo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
  $ cd repo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
  $ echo 0 > foo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
  $ hg -q commit -A -m initial
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
  $ hg bundle --all -t none-v1 ../initial.v1.hg
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
  1 changesets found
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
  $ cd ..
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
Test pushing bundle1 payload to a server with bundle1 disabled
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
  $ hg init no-bundle1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
  $ cd no-bundle1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
  > [server]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
  > bundle1 = false
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
    42
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    45
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
    46
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    48
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    49
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
    53
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
    54
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
    55
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
    61
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    62
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
    63
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
    65
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
    69
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
    71
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
    80
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    82
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    83
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    84
  o>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    85
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    86
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    87
  o> read(1) -> 1: 0
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    88
  result: 0
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    89
  remote output: 
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
    90
  e> read(-1) -> 115:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
    91
  e>     abort: incompatible Mercurial client; bundle2 required\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
    92
  e>     (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    93
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    94
  $ cd ..
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    95
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    96
Create a pretxnchangegroup hook that fails. Give it multiple modes of printing
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    97
output so we can test I/O capture and behavior.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    98
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    99
Test pushing to a server that has a pretxnchangegroup Python hook that fails
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   100
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   101
  $ cat > $TESTTMP/failhook << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   102
  > from __future__ import print_function
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   103
  > import sys
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   104
  > def hook1line(ui, repo, **kwargs):
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   105
  >     ui.write(b'ui.write 1 line\n')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   106
  >     ui.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   107
  >     return 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   108
  > def hook2lines(ui, repo, **kwargs):
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   109
  >     ui.write(b'ui.write 2 lines 1\n')
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   110
  >     ui.write(b'ui.write 2 lines 2\n')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   111
  >     ui.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   112
  >     return 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   113
  > def hook1lineflush(ui, repo, **kwargs):
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   114
  >     ui.write(b'ui.write 1 line flush\n')
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   115
  >     ui.flush()
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   116
  >     return 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   117
  > def hookmultiflush(ui, repo, **kwargs):
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   118
  >     ui.write(b'ui.write 1st\n')
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   119
  >     ui.flush()
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   120
  >     ui.write(b'ui.write 2nd\n')
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   121
  >     ui.flush()
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   122
  >     return 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   123
  > def hookwriteandwriteerr(ui, repo, **kwargs):
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   124
  >     ui.write(b'ui.write 1\n')
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   125
  >     ui.write_err(b'ui.write_err 1\n')
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   126
  >     ui.write(b'ui.write 2\n')
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   127
  >     ui.write_err(b'ui.write_err 2\n')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   128
  >     ui.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   129
  >     return 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   130
  > def hookprintstdout(ui, repo, **kwargs):
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   131
  >     print('printed line')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   132
  >     sys.stdout.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   133
  >     return 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   134
  > def hookprintandwrite(ui, repo, **kwargs):
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   135
  >     print('print 1')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   136
  >     sys.stdout.flush()
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   137
  >     ui.write(b'ui.write 1\n')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   138
  >     ui.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   139
  >     print('print 2')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   140
  >     sys.stdout.flush()
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
   141
  >     ui.write(b'ui.write 2\n')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   142
  >     ui.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   143
  >     return 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   144
  > def hookprintstderrandstdout(ui, repo, **kwargs):
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   145
  >     print('stdout 1')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   146
  >     sys.stdout.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   147
  >     print('stderr 1', file=sys.stderr)
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   148
  >     sys.stderr.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   149
  >     print('stdout 2')
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   150
  >     sys.stdout.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   151
  >     print('stderr 2', file=sys.stderr)
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   152
  >     sys.stderr.flush()
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   153
  >     return 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   154
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   155
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   156
  $ hg init failrepo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   157
  $ cd failrepo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   158
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   159
ui.write() in hook is redirected to stderr
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   160
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   161
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   162
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   163
  > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook1line
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   164
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   165
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   166
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   167
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   168
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   169
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   170
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   171
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   172
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   173
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   174
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   175
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   176
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   177
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   178
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   179
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   180
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   181
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   182
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   183
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   184
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   185
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   186
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   187
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   188
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   189
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   190
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   191
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   192
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   193
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   194
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   195
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   196
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   197
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   198
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   199
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   200
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   201
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   202
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   203
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   204
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   205
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   206
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   207
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   208
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   209
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   210
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   211
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   212
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   213
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   214
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   215
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   216
  o> read(1) -> 1: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   217
  result: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   218
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   219
  e> read(-1) -> 151:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   220
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   221
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   222
  e>     adding file changes\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   223
  e>     ui.write 1 line\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   224
  e>     transaction abort!\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   225
  e>     rollback completed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   226
  e>     abort: pretxnchangegroup.fail hook failed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   227
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   228
And a variation that writes multiple lines using ui.write
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   229
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   230
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   231
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   232
  > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook2lines
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   233
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   234
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   235
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   236
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   237
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   238
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   239
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   240
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   241
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   242
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   243
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   244
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   245
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   246
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   247
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   248
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   249
  i> flush() -> None
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   250
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   251
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   252
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   253
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   254
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   255
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   256
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   257
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   258
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   259
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   260
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   261
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   262
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   263
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   264
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   265
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   266
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   267
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   268
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   269
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   270
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   271
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   272
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   273
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   274
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   275
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   276
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   277
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   278
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   279
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   280
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   281
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   282
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   283
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   284
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   285
  o> read(1) -> 1: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   286
  result: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   287
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   288
  e> read(-1) -> 173:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   289
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   290
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   291
  e>     adding file changes\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   292
  e>     ui.write 2 lines 1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   293
  e>     ui.write 2 lines 2\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   294
  e>     transaction abort!\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   295
  e>     rollback completed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   296
  e>     abort: pretxnchangegroup.fail hook failed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   297
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   298
And a variation that does a ui.flush() after writing output
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   299
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   300
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   301
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   302
  > pretxnchangegroup.fail = python:$TESTTMP/failhook:hook1lineflush
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   303
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   304
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   305
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   306
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   307
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   308
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   309
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   310
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   311
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   312
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   313
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   314
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   315
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   316
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   317
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   318
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   319
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   320
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   321
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   322
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   323
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   324
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   325
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   326
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   327
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   328
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   329
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   330
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   331
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   332
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   333
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   334
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   335
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   336
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   337
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   338
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   339
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   340
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   341
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   342
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   343
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   344
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   345
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   346
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   347
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   348
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   349
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   350
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   351
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   352
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   353
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   354
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   355
  o> read(1) -> 1: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   356
  result: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   357
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   358
  e> read(-1) -> 157:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   359
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   360
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   361
  e>     adding file changes\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   362
  e>     ui.write 1 line flush\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   363
  e>     transaction abort!\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   364
  e>     rollback completed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   365
  e>     abort: pretxnchangegroup.fail hook failed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   366
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   367
Multiple writes + flush
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   368
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   369
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   370
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   371
  > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookmultiflush
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   372
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   373
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   374
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   375
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   376
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   377
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   378
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   379
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   380
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   381
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   382
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   383
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   384
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   385
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   386
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   387
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   388
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   389
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   390
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   391
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   392
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   393
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   394
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   395
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   396
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   397
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   398
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   399
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   400
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   401
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   402
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   403
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   404
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   405
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   406
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   407
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   408
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   409
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   410
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   411
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   412
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   413
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   414
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   415
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   416
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   417
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   418
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   419
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   420
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   421
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   422
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   423
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   424
  o> read(1) -> 1: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   425
  result: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   426
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   427
  e> read(-1) -> 161:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   428
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   429
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   430
  e>     adding file changes\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   431
  e>     ui.write 1st\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   432
  e>     ui.write 2nd\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   433
  e>     transaction abort!\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   434
  e>     rollback completed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   435
  e>     abort: pretxnchangegroup.fail hook failed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   436
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   437
ui.write() + ui.write_err() output is captured
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   438
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   439
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   440
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   441
  > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookwriteandwriteerr
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   442
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   443
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   444
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   445
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   446
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   447
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   448
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   449
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   450
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   451
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   452
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   453
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   454
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   455
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   456
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   457
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   458
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   459
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   460
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   461
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   462
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   463
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   464
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   465
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   466
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   467
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   468
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   469
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   470
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   471
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   472
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   473
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   474
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   475
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   476
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   477
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   478
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   479
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   480
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   481
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   482
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   483
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   484
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   485
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   486
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   487
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   488
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   489
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   490
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   491
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   492
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   493
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   494
  o> read(1) -> 1: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   495
  result: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   496
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   497
  e> read(-1) -> 187:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   498
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   499
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   500
  e>     adding file changes\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   501
  e>     ui.write 1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   502
  e>     ui.write_err 1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   503
  e>     ui.write 2\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   504
  e>     ui.write_err 2\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   505
  e>     transaction abort!\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   506
  e>     rollback completed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   507
  e>     abort: pretxnchangegroup.fail hook failed\n
48526
04688c51f81f exchangev2: remove it
Raphaël Gomès <rgomes@octobus.net>
parents: 46880
diff changeset
   508
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   509
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   510
print() output is captured
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   511
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   512
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   513
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   514
  > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintstdout
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   515
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   516
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   517
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   518
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   519
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   520
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   521
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   522
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   523
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   524
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   525
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   526
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   527
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   528
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   529
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   530
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   531
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   532
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   533
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   534
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   535
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   536
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   537
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   538
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   539
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   540
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   541
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   542
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   543
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   544
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   545
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   546
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   547
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   548
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   549
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   550
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   551
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   552
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   553
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   554
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   555
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   556
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   557
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   558
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   559
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   560
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   561
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   562
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   563
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   564
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   565
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   566
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   567
  o> read(1) -> 1: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   568
  result: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   569
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   570
  e> read(-1) -> 148:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   571
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   572
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   573
  e>     adding file changes\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   574
  e>     printed line\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   575
  e>     transaction abort!\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   576
  e>     rollback completed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   577
  e>     abort: pretxnchangegroup.fail hook failed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   578
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   579
Mixed print() and ui.write() are both captured
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   580
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   581
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   582
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   583
  > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintandwrite
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   584
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   585
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   586
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   587
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   588
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   589
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   590
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   591
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   592
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   593
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   594
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   595
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   596
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   597
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   598
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   599
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   600
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   601
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   602
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   603
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   604
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   605
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   606
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   607
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   608
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   609
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   610
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   611
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   612
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   613
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   614
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   615
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   616
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   617
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   618
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   619
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   620
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   621
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   622
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   623
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   624
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   625
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   626
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   627
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   628
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   629
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   630
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   631
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   632
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   633
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   634
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   635
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   636
  o> read(1) -> 1: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   637
  result: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   638
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   639
  e> read(-1) -> 173:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   640
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   641
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   642
  e>     adding file changes\n
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   643
  e>     print 1\n
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   644
  e>     ui.write 1\n
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   645
  e>     print 2\n
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   646
  e>     ui.write 2\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   647
  e>     transaction abort!\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   648
  e>     rollback completed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   649
  e>     abort: pretxnchangegroup.fail hook failed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   650
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   651
print() to stdout and stderr both get captured
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   652
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   653
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   654
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   655
  > pretxnchangegroup.fail = python:$TESTTMP/failhook:hookprintstderrandstdout
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   656
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   657
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   658
  $ debugwireproto << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   659
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   660
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   661
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   662
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   663
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   664
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   665
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   666
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   667
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   668
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   669
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   670
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   671
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   672
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   673
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   674
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   675
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   676
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   677
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   678
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   679
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   680
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   681
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   682
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   683
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   684
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   685
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   686
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   687
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   688
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   689
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   690
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   691
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   692
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   693
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   694
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   695
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   696
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   697
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   698
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   699
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   700
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   701
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   702
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   703
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   704
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   705
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   706
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   707
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   708
  o> read(1) -> 1: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   709
  result: 0
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
   710
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   711
  e> read(-1) -> 171:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   712
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   713
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   714
  e>     adding file changes\n
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   715
  e>     stdout 1\n
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   716
  e>     stderr 1\n
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
   717
  e>     stdout 2\n
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   718
  e>     stderr 2\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   719
  e>     transaction abort!\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   720
  e>     rollback completed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   721
  e>     abort: pretxnchangegroup.fail hook failed\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   722
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   723
Shell hook writing to stdout has output captured
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   724
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   725
  $ cat > $TESTTMP/hook.sh << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   726
  > echo 'stdout 1'
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   727
  > echo 'stdout 2'
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   728
  > exit 1
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   729
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   730
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   731
  $ cat > .hg/hgrc << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   732
  > [hooks]
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   733
  > pretxnchangegroup.fail = sh $TESTTMP/hook.sh
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   734
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   735
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   736
  $ debugwireproto << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   737
  > command unbundle
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   738
  > # This is "force" in hex.
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   739
  >     heads 666f726365
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   740
  >     PUSHFILE ../initial.v1.hg
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   741
  > readavailable
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   742
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   743
  testing ssh1
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   744
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   745
  i> write(104) -> 104:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   746
  i>     hello\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   747
  i>     between\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   748
  i>     pairs 81\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   749
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   750
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   751
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   752
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   753
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   754
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   755
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   756
  o>     1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   757
  o> readline() -> 1:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   758
  o>     \n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   759
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   760
  i> write(9) -> 9:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   761
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   762
  i> write(9) -> 9:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   763
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   764
  i> write(10) -> 10: 666f726365
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   765
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   766
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   767
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   768
  i> write(4) -> 4:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   769
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   770
  i> write(426) -> 426:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   771
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   772
  i>     test\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   773
  i>     0 0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   774
  i>     foo\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   775
  i>     \n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   776
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   777
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   778
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   779
  i> write(2) -> 2:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   780
  i>     0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   781
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   782
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   783
  o>     0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   784
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   785
  o>     1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   786
  o> read(1) -> 1: 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   787
  result: 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   788
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   789
  e> read(-1) -> 167:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   790
  e>     adding changesets\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   791
  e>     adding manifests\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   792
  e>     adding file changes\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   793
  e>     stdout 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   794
  e>     stdout 2\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   795
  e>     transaction abort!\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   796
  e>     rollback completed\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   797
  e>     abort: pretxnchangegroup.fail hook exited with status 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   798
Shell hook writing to stderr has output captured
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   799
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   800
  $ cat > $TESTTMP/hook.sh << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   801
  > echo 'stderr 1' 1>&2
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   802
  > echo 'stderr 2' 1>&2
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   803
  > exit 1
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   804
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   805
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   806
  $ debugwireproto << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   807
  > command unbundle
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   808
  > # This is "force" in hex.
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   809
  >     heads 666f726365
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   810
  >     PUSHFILE ../initial.v1.hg
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   811
  > readavailable
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   812
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   813
  testing ssh1
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   814
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   815
  i> write(104) -> 104:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   816
  i>     hello\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   817
  i>     between\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   818
  i>     pairs 81\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   819
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   820
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   821
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   822
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   823
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   824
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   825
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   826
  o>     1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   827
  o> readline() -> 1:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   828
  o>     \n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   829
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   830
  i> write(9) -> 9:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   831
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   832
  i> write(9) -> 9:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   833
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   834
  i> write(10) -> 10: 666f726365
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   835
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   836
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   837
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   838
  i> write(4) -> 4:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   839
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   840
  i> write(426) -> 426:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   841
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   842
  i>     test\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   843
  i>     0 0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   844
  i>     foo\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   845
  i>     \n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   846
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   847
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   848
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   849
  i> write(2) -> 2:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   850
  i>     0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   851
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   852
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   853
  o>     0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   854
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   855
  o>     1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   856
  o> read(1) -> 1: 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   857
  result: 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   858
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   859
  e> read(-1) -> 167:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   860
  e>     adding changesets\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   861
  e>     adding manifests\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   862
  e>     adding file changes\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   863
  e>     stderr 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   864
  e>     stderr 2\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   865
  e>     transaction abort!\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   866
  e>     rollback completed\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   867
  e>     abort: pretxnchangegroup.fail hook exited with status 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   868
Shell hook writing to stdout and stderr has output captured
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   869
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   870
  $ cat > $TESTTMP/hook.sh << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   871
  > echo 'stdout 1'
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   872
  > echo 'stderr 1' 1>&2
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   873
  > echo 'stdout 2'
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   874
  > echo 'stderr 2' 1>&2
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   875
  > exit 1
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   876
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   877
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   878
  $ debugwireproto << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   879
  > command unbundle
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   880
  > # This is "force" in hex.
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   881
  >     heads 666f726365
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   882
  >     PUSHFILE ../initial.v1.hg
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   883
  > readavailable
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   884
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   885
  testing ssh1
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   886
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   887
  i> write(104) -> 104:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   888
  i>     hello\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   889
  i>     between\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   890
  i>     pairs 81\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   891
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   892
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   893
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   894
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   895
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   896
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   897
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   898
  o>     1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   899
  o> readline() -> 1:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   900
  o>     \n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   901
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   902
  i> write(9) -> 9:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   903
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   904
  i> write(9) -> 9:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   905
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   906
  i> write(10) -> 10: 666f726365
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   907
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   908
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   909
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   910
  i> write(4) -> 4:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   911
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   912
  i> write(426) -> 426:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   913
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   914
  i>     test\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   915
  i>     0 0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   916
  i>     foo\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   917
  i>     \n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   918
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   919
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   920
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   921
  i> write(2) -> 2:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   922
  i>     0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   923
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   924
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   925
  o>     0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   926
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   927
  o>     1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   928
  o> read(1) -> 1: 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   929
  result: 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   930
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
   931
  e> read(-1) -> 185:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   932
  e>     adding changesets\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   933
  e>     adding manifests\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   934
  e>     adding file changes\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   935
  e>     stdout 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   936
  e>     stderr 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   937
  e>     stdout 2\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   938
  e>     stderr 2\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   939
  e>     transaction abort!\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   940
  e>     rollback completed\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   941
  e>     abort: pretxnchangegroup.fail hook exited with status 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   942
Shell and Python hooks writing to stdout and stderr have output captured
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   943
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   944
  $ cat > $TESTTMP/hook.sh << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   945
  > echo 'shell stdout 1'
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   946
  > echo 'shell stderr 1' 1>&2
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   947
  > echo 'shell stdout 2'
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   948
  > echo 'shell stderr 2' 1>&2
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   949
  > exit 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   950
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   951
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   952
  $ cat > .hg/hgrc << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   953
  > [hooks]
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   954
  > pretxnchangegroup.a = sh $TESTTMP/hook.sh
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   955
  > pretxnchangegroup.b = python:$TESTTMP/failhook:hookprintstderrandstdout
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   956
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   957
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   958
  $ debugwireproto << EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   959
  > command unbundle
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   960
  > # This is "force" in hex.
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   961
  >     heads 666f726365
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   962
  >     PUSHFILE ../initial.v1.hg
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   963
  > readavailable
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   964
  > EOF
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   965
  testing ssh1
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   966
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   967
  i> write(104) -> 104:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   968
  i>     hello\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   969
  i>     between\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   970
  i>     pairs 81\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   971
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   972
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   973
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   974
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   975
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
   976
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   977
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   978
  o>     1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   979
  o> readline() -> 1:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   980
  o>     \n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   981
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   982
  i> write(9) -> 9:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   983
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   984
  i> write(9) -> 9:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   985
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   986
  i> write(10) -> 10: 666f726365
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   987
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   988
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   989
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   990
  i> write(4) -> 4:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   991
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
   992
  i> write(426) -> 426:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   993
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   994
  i>     test\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   995
  i>     0 0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   996
  i>     foo\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   997
  i>     \n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   998
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
   999
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1000
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1001
  i> write(2) -> 2:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1002
  i>     0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1003
  i> flush() -> None
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1004
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1005
  o>     0\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1006
  o> readline() -> 2:
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1007
  o>     1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1008
  o> read(1) -> 1: 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1009
  result: 0
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1010
  remote output: 
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
  1011
  e> read(-1) -> 228:
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1012
  e>     adding changesets\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1013
  e>     adding manifests\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1014
  e>     adding file changes\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1015
  e>     shell stdout 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1016
  e>     shell stderr 1\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1017
  e>     shell stdout 2\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1018
  e>     shell stderr 2\n
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
  1019
  e>     stdout 1\n
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1020
  e>     stderr 1\n
37943
45a669bad421 test-ssh: add some flush() to make output deterministic
Yuya Nishihara <yuya@tcha.org>
parents: 37413
diff changeset
  1021
  e>     stdout 2\n
36614
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1022
  e>     stderr 2\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1023
  e>     transaction abort!\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1024
  e>     rollback completed\n
1fa02265fae2 tests: add more tests around hook output and getbundle
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
  1025
  e>     abort: pretxnchangegroup.b hook failed\n
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1026
  $ cd ..
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1027
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1028
Pushing a bundle1 with no output
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1029
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1030
  $ hg init simplerepo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1031
  $ cd simplerepo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1032
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1033
  $ debugwireproto 1 << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1034
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1035
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1036
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1037
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1038
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1039
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1040
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1041
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1042
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1043
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1044
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1045
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1046
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1047
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1048
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
  1049
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
  1050
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
  1051
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1052
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1053
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1054
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1055
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1056
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1057
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1058
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1059
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1060
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1061
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1062
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1063
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1064
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1065
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1066
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1067
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1068
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1069
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1070
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1071
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1072
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1073
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1074
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1075
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1076
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1077
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1078
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1079
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1080
  o>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1081
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1082
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1083
  o> read(1) -> 1: 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1084
  result: 1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1085
  remote output: 
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1086
  e> read(-1) -> 100:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1087
  e>     adding changesets\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1088
  e>     adding manifests\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1089
  e>     adding file changes\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1090
  e>     added 1 changesets with 1 changes to 1 files\n
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1091
  $ cd ..
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1092
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1093
Pushing a bundle1 with ui.write() and ui.write_err()
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1094
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1095
  $ cat > $TESTTMP/hook << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1096
  > def hookuiwrite(ui, repo, **kwargs):
36660
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
  1097
  >     ui.write(b'ui.write 1\n')
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
  1098
  >     ui.write_err(b'ui.write_err 1\n')
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
  1099
  >     ui.write(b'ui.write 2\n')
11b279a75bf1 tests: fix inline extension bytes in test-ssh-proto-unbundle.t
Augie Fackler <augie@google.com>
parents: 36631
diff changeset
  1100
  >     ui.write_err(b'ui.write_err 2\n')
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1101
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1102
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1103
  $ hg init uiwriterepo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1104
  $ cd uiwriterepo
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1105
  $ cat > .hg/hgrc << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1106
  > [hooks]
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1107
  > pretxnchangegroup.hook = python:$TESTTMP/hook:hookuiwrite
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1108
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1109
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1110
  $ debugwireproto 1 << EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1111
  > command unbundle
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1112
  > # This is "force" in hex.
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1113
  >     heads 666f726365
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1114
  >     PUSHFILE ../initial.v1.hg
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1115
  > readavailable
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1116
  > EOF
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1117
  testing ssh1
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1118
  creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1119
  i> write(104) -> 104:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1120
  i>     hello\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1121
  i>     between\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1122
  i>     pairs 81\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1123
  i>     0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1124
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1125
  o> readline() -> 4:
48646
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
  1126
  o>     \d+\\n (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
  1127
  o> readline\(\) -> \d+: (re)
77f8f8caf859 stream-requirements: smoother matching in test-ssh-proto-unbundle.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
  1128
  o>     capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1129
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1130
  o>     1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1131
  o> readline() -> 1:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1132
  o>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1133
  sending unbundle command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1134
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1135
  i>     unbundle\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1136
  i> write(9) -> 9:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1137
  i>     heads 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1138
  i> write(10) -> 10: 666f726365
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1139
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1140
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1141
  o>     0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1142
  i> write(4) -> 4:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1143
  i>     426\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1144
  i> write(426) -> 426:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1145
  i>     HG10UN\x00\x00\x00\x9eh\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>cba485ca3678256e044428f70f58291196f6e9de\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1146
  i>     test\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1147
  i>     0 0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1148
  i>     foo\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1149
  i>     \n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1150
  i>     initial\x00\x00\x00\x00\x00\x00\x00\x8d\xcb\xa4\x85\xca6x%n\x04D(\xf7\x0fX)\x11\x96\xf6\xe9\xde\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1151
  i>     \x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00b6/\xef(L\xe2\xca\x02\xae\xcc\x8d\xe6\xd5\xe8\xa1\xc3\xaf\x05V\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\x98b\x13\xbdD\x85\xeaQS55\xe3\xfc\x9ex\x00zq\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x020\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1152
  i>     \x00\x00\x00\x00\x00\x00\x00\x00
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36628
diff changeset
  1153
  i> write(2) -> 2:
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1154
  i>     0\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1155
  i> flush() -> None
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1156
  o> readline() -> 2:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1157
  o>     0\n
36608
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1158
  o> readline() -> 2:
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1159
  o>     1\n
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1160
  o> read(1) -> 1: 1
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1161
  result: 1
1151c731686e sshpeer: don't read from stderr when that behavior is disabled
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36534
diff changeset
  1162
  remote output: 
36534
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1163
  e> read(-1) -> 152:
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1164
  e>     adding changesets\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1165
  e>     adding manifests\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1166
  e>     adding file changes\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1167
  e>     ui.write 1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1168
  e>     ui.write_err 1\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1169
  e>     ui.write 2\n
5faeabb07cf5 debugcommands: support for triggering push protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
  1170
  e>     ui.write_err 2\n
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
  1171
  e>     added 1 changesets with 1 changes to 1 files\n