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