##// END OF EJS Templates
debugwireproto: close the write end before consuming all available data...
Yuya Nishihara -
r36861:31581528 default
parent child Browse files
Show More
@@ -2690,7 +2690,8 b' def debugwireproto(ui, repo, **opts):'
2690 2690 readavailable
2691 2691 -------------
2692 2692
2693 Read all available data from the server.
2693 Close the write end of the connection and read all available data from
2694 the server.
2694 2695
2695 2696 If the connection to the server encompasses multiple pipes, we poll both
2696 2697 pipes and read available data.
@@ -2835,17 +2836,9 b' def debugwireproto(ui, repo, **opts):'
2835 2836 elif action == 'close':
2836 2837 peer.close()
2837 2838 elif action == 'readavailable':
2838 fds = [stdout.fileno(), stderr.fileno()]
2839 try:
2840 act = util.poll(fds)
2841 except NotImplementedError:
2842 # non supported yet case, assume all have data.
2843 act = fds
2844
2845 if stdout.fileno() in act:
2846 util.readpipe(stdout)
2847 if stderr.fileno() in act:
2848 util.readpipe(stderr)
2839 stdin.close()
2840 stdout.read()
2841 stderr.read()
2849 2842 elif action == 'readline':
2850 2843 stdout.readline()
2851 2844 else:
@@ -93,6 +93,7 b' Test pushing bundle1 payload to a server'
93 93 o> read(1) -> 1: 0
94 94 result: 0
95 95 remote output:
96 o> read(-1) -> 0:
96 97 e> read(-1) -> 115:
97 98 e> abort: incompatible Mercurial client; bundle2 required\n
98 99 e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n
@@ -143,6 +144,7 b' Test pushing bundle1 payload to a server'
143 144 o> read(1) -> 1: 0
144 145 result: 0
145 146 remote output:
147 o> read(-1) -> 0:
146 148 e> read(-1) -> 115:
147 149 e> abort: incompatible Mercurial client; bundle2 required\n
148 150 e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n
@@ -260,6 +262,7 b' ui.write() in hook is redirected to stde'
260 262 o> read(1) -> 1: 0
261 263 result: 0
262 264 remote output:
265 o> read(-1) -> 0:
263 266 e> read(-1) -> 196:
264 267 e> adding changesets\n
265 268 e> adding manifests\n
@@ -316,6 +319,7 b' ui.write() in hook is redirected to stde'
316 319 o> read(1) -> 1: 0
317 320 result: 0
318 321 remote output:
322 o> read(-1) -> 0:
319 323 e> read(-1) -> 196:
320 324 e> adding changesets\n
321 325 e> adding manifests\n
@@ -386,6 +390,7 b' And a variation that writes multiple lin'
386 390 o> read(1) -> 1: 0
387 391 result: 0
388 392 remote output:
393 o> read(-1) -> 0:
389 394 e> read(-1) -> 218:
390 395 e> adding changesets\n
391 396 e> adding manifests\n
@@ -443,6 +448,7 b' And a variation that writes multiple lin'
443 448 o> read(1) -> 1: 0
444 449 result: 0
445 450 remote output:
451 o> read(-1) -> 0:
446 452 e> read(-1) -> 218:
447 453 e> adding changesets\n
448 454 e> adding manifests\n
@@ -514,6 +520,7 b' And a variation that does a ui.flush() a'
514 520 o> read(1) -> 1: 0
515 521 result: 0
516 522 remote output:
523 o> read(-1) -> 0:
517 524 e> read(-1) -> 202:
518 525 e> adding changesets\n
519 526 e> adding manifests\n
@@ -570,6 +577,7 b' And a variation that does a ui.flush() a'
570 577 o> read(1) -> 1: 0
571 578 result: 0
572 579 remote output:
580 o> read(-1) -> 0:
573 581 e> read(-1) -> 202:
574 582 e> adding changesets\n
575 583 e> adding manifests\n
@@ -640,6 +648,7 b' Multiple writes + flush'
640 648 o> read(1) -> 1: 0
641 649 result: 0
642 650 remote output:
651 o> read(-1) -> 0:
643 652 e> read(-1) -> 206:
644 653 e> adding changesets\n
645 654 e> adding manifests\n
@@ -697,6 +706,7 b' Multiple writes + flush'
697 706 o> read(1) -> 1: 0
698 707 result: 0
699 708 remote output:
709 o> read(-1) -> 0:
700 710 e> read(-1) -> 206:
701 711 e> adding changesets\n
702 712 e> adding manifests\n
@@ -768,6 +778,7 b' ui.write() + ui.write_err() output is ca'
768 778 o> read(1) -> 1: 0
769 779 result: 0
770 780 remote output:
781 o> read(-1) -> 0:
771 782 e> read(-1) -> 232:
772 783 e> adding changesets\n
773 784 e> adding manifests\n
@@ -827,6 +838,7 b' ui.write() + ui.write_err() output is ca'
827 838 o> read(1) -> 1: 0
828 839 result: 0
829 840 remote output:
841 o> read(-1) -> 0:
830 842 e> read(-1) -> 232:
831 843 e> adding changesets\n
832 844 e> adding manifests\n
@@ -900,6 +912,7 b' print() output is captured'
900 912 o> read(1) -> 1: 0
901 913 result: 0
902 914 remote output:
915 o> read(-1) -> 0:
903 916 e> read(-1) -> 193:
904 917 e> adding changesets\n
905 918 e> adding manifests\n
@@ -956,6 +969,7 b' print() output is captured'
956 969 o> read(1) -> 1: 0
957 970 result: 0
958 971 remote output:
972 o> read(-1) -> 0:
959 973 e> read(-1) -> 193:
960 974 e> adding changesets\n
961 975 e> adding manifests\n
@@ -1026,6 +1040,7 b' Mixed print() and ui.write() are both ca'
1026 1040 o> read(1) -> 1: 0
1027 1041 result: 0
1028 1042 remote output:
1043 o> read(-1) -> 0:
1029 1044 e> read(-1) -> 218:
1030 1045 e> adding changesets\n
1031 1046 e> adding manifests\n
@@ -1085,6 +1100,7 b' Mixed print() and ui.write() are both ca'
1085 1100 o> read(1) -> 1: 0
1086 1101 result: 0
1087 1102 remote output:
1103 o> read(-1) -> 0:
1088 1104 e> read(-1) -> 218:
1089 1105 e> adding changesets\n
1090 1106 e> adding manifests\n
@@ -1158,6 +1174,7 b' print() to stdout and stderr both get ca'
1158 1174 o> read(1) -> 1: 0
1159 1175 result: 0
1160 1176 remote output:
1177 o> read(-1) -> 0:
1161 1178 e> read(-1) -> 216:
1162 1179 e> adding changesets\n
1163 1180 e> adding manifests\n
@@ -1217,6 +1234,7 b' print() to stdout and stderr both get ca'
1217 1234 o> read(1) -> 1: 0
1218 1235 result: 0
1219 1236 remote output:
1237 o> read(-1) -> 0:
1220 1238 e> read(-1) -> 216:
1221 1239 e> adding changesets\n
1222 1240 e> adding manifests\n
@@ -1296,6 +1314,7 b' Shell hook writing to stdout has output '
1296 1314 o> read(1) -> 1: 0
1297 1315 result: 0
1298 1316 remote output:
1317 o> read(-1) -> 0:
1299 1318 e> read(-1) -> 212:
1300 1319 e> adding changesets\n
1301 1320 e> adding manifests\n
@@ -1353,6 +1372,7 b' Shell hook writing to stdout has output '
1353 1372 o> read(1) -> 1: 0
1354 1373 result: 0
1355 1374 remote output:
1375 o> read(-1) -> 0:
1356 1376 e> read(-1) -> 212:
1357 1377 e> adding changesets\n
1358 1378 e> adding manifests\n
@@ -1425,6 +1445,7 b' Shell hook writing to stderr has output '
1425 1445 o> read(1) -> 1: 0
1426 1446 result: 0
1427 1447 remote output:
1448 o> read(-1) -> 0:
1428 1449 e> read(-1) -> 212:
1429 1450 e> adding changesets\n
1430 1451 e> adding manifests\n
@@ -1482,6 +1503,7 b' Shell hook writing to stderr has output '
1482 1503 o> read(1) -> 1: 0
1483 1504 result: 0
1484 1505 remote output:
1506 o> read(-1) -> 0:
1485 1507 e> read(-1) -> 212:
1486 1508 e> adding changesets\n
1487 1509 e> adding manifests\n
@@ -1556,6 +1578,7 b' Shell hook writing to stdout and stderr '
1556 1578 o> read(1) -> 1: 0
1557 1579 result: 0
1558 1580 remote output:
1581 o> read(-1) -> 0:
1559 1582 e> read(-1) -> 230:
1560 1583 e> adding changesets\n
1561 1584 e> adding manifests\n
@@ -1615,6 +1638,7 b' Shell hook writing to stdout and stderr '
1615 1638 o> read(1) -> 1: 0
1616 1639 result: 0
1617 1640 remote output:
1641 o> read(-1) -> 0:
1618 1642 e> read(-1) -> 230:
1619 1643 e> adding changesets\n
1620 1644 e> adding manifests\n
@@ -1697,6 +1721,7 b' Shell and Python hooks writing to stdout'
1697 1721 o> read(1) -> 1: 0
1698 1722 result: 0
1699 1723 remote output:
1724 o> read(-1) -> 0:
1700 1725 e> read(-1) -> 273:
1701 1726 e> adding changesets\n
1702 1727 e> adding manifests\n
@@ -1760,6 +1785,7 b' Shell and Python hooks writing to stdout'
1760 1785 o> read(1) -> 1: 0
1761 1786 result: 0
1762 1787 remote output:
1788 o> read(-1) -> 0:
1763 1789 e> read(-1) -> 273:
1764 1790 e> adding changesets\n
1765 1791 e> adding manifests\n
@@ -1837,6 +1863,7 b' Pushing a bundle1 with no output'
1837 1863 o> read(1) -> 1: 1
1838 1864 result: 1
1839 1865 remote output:
1866 o> read(-1) -> 0:
1840 1867 e> read(-1) -> 100:
1841 1868 e> adding changesets\n
1842 1869 e> adding manifests\n
@@ -1889,6 +1916,7 b' Pushing a bundle1 with no output'
1889 1916 o> read(1) -> 1: 1
1890 1917 result: 1
1891 1918 remote output:
1919 o> read(-1) -> 0:
1892 1920 e> read(-1) -> 100:
1893 1921 e> adding changesets\n
1894 1922 e> adding manifests\n
@@ -1967,6 +1995,7 b' Pushing a bundle1 with ui.write() and ui'
1967 1995 o> read(1) -> 1: 1
1968 1996 result: 1
1969 1997 remote output:
1998 o> read(-1) -> 0:
1970 1999 e> read(-1) -> 152:
1971 2000 e> adding changesets\n
1972 2001 e> adding manifests\n
@@ -2023,6 +2052,7 b' Pushing a bundle1 with ui.write() and ui'
2023 2052 o> read(1) -> 1: 1
2024 2053 result: 1
2025 2054 remote output:
2055 o> read(-1) -> 0:
2026 2056 e> read(-1) -> 152:
2027 2057 e> adding changesets\n
2028 2058 e> adding manifests\n
@@ -1138,6 +1138,7 b' Multiple upgrades is not allowed'
1138 1138 i> hello\n
1139 1139 o> readline() -> 1:
1140 1140 o> \n
1141 o> read(-1) -> 0:
1141 1142 e> read(-1) -> 42:
1142 1143 e> cannot upgrade protocols multiple times\n
1143 1144 e> -\n
@@ -1229,6 +1230,7 b' Upgrade request must be followed by hell'
1229 1230 i> invalid\n
1230 1231 o> readline() -> 1:
1231 1232 o> \n
1233 o> read(-1) -> 0:
1232 1234 e> read(-1) -> 46:
1233 1235 e> malformed handshake protocol: missing hello\n
1234 1236 e> -\n
@@ -1248,6 +1250,7 b' Upgrade request must be followed by hell'
1248 1250 i> invalid\n
1249 1251 o> readline() -> 1:
1250 1252 o> \n
1253 o> read(-1) -> 0:
1251 1254 e> read(-1) -> 48:
1252 1255 e> malformed handshake protocol: missing between\n
1253 1256 e> -\n
@@ -1269,6 +1272,7 b' Upgrade request must be followed by hell'
1269 1272 i> invalid\n
1270 1273 o> readline() -> 1:
1271 1274 o> \n
1275 o> read(-1) -> 0:
1272 1276 e> read(-1) -> 49:
1273 1277 e> malformed handshake protocol: missing pairs 81\n
1274 1278 e> -\n
General Comments 0
You need to be logged in to leave comments. Login now