comparison tests/test-ssh-proto.t @ 37322:a67fd1fe5109

stringutil: drop escapedata() in favor of escapestr() They are quite similar. Let's choose one that uses standard Python escape.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 04 Apr 2018 23:26:49 +0900
parents 2f859ad7ed8c
children afcfdf53e4b5
comparison
equal deleted inserted replaced
37321:e826fe7a08c7 37322:a67fd1fe5109
1340 i> write(10) -> 10: namespaces 1340 i> write(10) -> 10: namespaces
1341 i> flush() -> None 1341 i> flush() -> None
1342 o> bufferedreadline() -> 3: 1342 o> bufferedreadline() -> 3:
1343 o> 30\n 1343 o> 30\n
1344 o> bufferedread(30) -> 30: 1344 o> bufferedread(30) -> 30:
1345 o> bookmarks \n 1345 o> bookmarks\t\n
1346 o> namespaces \n 1346 o> namespaces\t\n
1347 o> phases 1347 o> phases\t
1348 response: b'bookmarks \nnamespaces \nphases ' 1348 response: b'bookmarks\t\nnamespaces\t\nphases\t'
1349 1349
1350 testing ssh2 1350 testing ssh2
1351 creating ssh peer from handshake results 1351 creating ssh peer from handshake results
1352 i> write(171) -> 171: 1352 i> write(171) -> 171:
1353 i> upgrade * proto=exp-ssh-v2-0001\n (glob) 1353 i> upgrade * proto=exp-ssh-v2-0001\n (glob)
1371 i> write(10) -> 10: namespaces 1371 i> write(10) -> 10: namespaces
1372 i> flush() -> None 1372 i> flush() -> None
1373 o> bufferedreadline() -> 3: 1373 o> bufferedreadline() -> 3:
1374 o> 30\n 1374 o> 30\n
1375 o> bufferedread(30) -> 30: 1375 o> bufferedread(30) -> 30:
1376 o> bookmarks \n 1376 o> bookmarks\t\n
1377 o> namespaces \n 1377 o> namespaces\t\n
1378 o> phases 1378 o> phases\t
1379 response: b'bookmarks \nnamespaces \nphases ' 1379 response: b'bookmarks\t\nnamespaces\t\nphases\t'
1380 1380
1381 $ cd .. 1381 $ cd ..
1382 1382
1383 Test listkeys for bookmarks 1383 Test listkeys for bookmarks
1384 1384
1480 i> namespace 9\n 1480 i> namespace 9\n
1481 i> write(9) -> 9: bookmarks 1481 i> write(9) -> 9: bookmarks
1482 i> flush() -> None 1482 i> flush() -> None
1483 o> bufferedreadline() -> 3: 1483 o> bufferedreadline() -> 3:
1484 o> 46\n 1484 o> 46\n
1485 o> bufferedread(46) -> 46: bookA 68986213bd4485ea51533535e3fc9e78007a711f 1485 o> bufferedread(46) -> 46: bookA\t68986213bd4485ea51533535e3fc9e78007a711f
1486 response: b'bookA 68986213bd4485ea51533535e3fc9e78007a711f' 1486 response: b'bookA\t68986213bd4485ea51533535e3fc9e78007a711f'
1487 1487
1488 testing ssh2 1488 testing ssh2
1489 creating ssh peer from handshake results 1489 creating ssh peer from handshake results
1490 i> write(171) -> 171: 1490 i> write(171) -> 171:
1491 i> upgrade * proto=exp-ssh-v2-0001\n (glob) 1491 i> upgrade * proto=exp-ssh-v2-0001\n (glob)
1508 i> namespace 9\n 1508 i> namespace 9\n
1509 i> write(9) -> 9: bookmarks 1509 i> write(9) -> 9: bookmarks
1510 i> flush() -> None 1510 i> flush() -> None
1511 o> bufferedreadline() -> 3: 1511 o> bufferedreadline() -> 3:
1512 o> 46\n 1512 o> 46\n
1513 o> bufferedread(46) -> 46: bookA 68986213bd4485ea51533535e3fc9e78007a711f 1513 o> bufferedread(46) -> 46: bookA\t68986213bd4485ea51533535e3fc9e78007a711f
1514 response: b'bookA 68986213bd4485ea51533535e3fc9e78007a711f' 1514 response: b'bookA\t68986213bd4485ea51533535e3fc9e78007a711f'
1515 1515
1516 With multiple bookmarks set 1516 With multiple bookmarks set
1517 1517
1518 $ hg book -r 1 bookB 1518 $ hg book -r 1 bookB
1519 $ debugwireproto << EOF 1519 $ debugwireproto << EOF
1544 i> write(9) -> 9: bookmarks 1544 i> write(9) -> 9: bookmarks
1545 i> flush() -> None 1545 i> flush() -> None
1546 o> bufferedreadline() -> 3: 1546 o> bufferedreadline() -> 3:
1547 o> 93\n 1547 o> 93\n
1548 o> bufferedread(93) -> 93: 1548 o> bufferedread(93) -> 93:
1549 o> bookA 68986213bd4485ea51533535e3fc9e78007a711f\n 1549 o> bookA\t68986213bd4485ea51533535e3fc9e78007a711f\n
1550 o> bookB 1880f3755e2e52e3199e0ee5638128b08642f34d 1550 o> bookB\t1880f3755e2e52e3199e0ee5638128b08642f34d
1551 response: b'bookA 68986213bd4485ea51533535e3fc9e78007a711f\nbookB 1880f3755e2e52e3199e0ee5638128b08642f34d' 1551 response: b'bookA\t68986213bd4485ea51533535e3fc9e78007a711f\nbookB\t1880f3755e2e52e3199e0ee5638128b08642f34d'
1552 1552
1553 testing ssh2 1553 testing ssh2
1554 creating ssh peer from handshake results 1554 creating ssh peer from handshake results
1555 i> write(171) -> 171: 1555 i> write(171) -> 171:
1556 i> upgrade * proto=exp-ssh-v2-0001\n (glob) 1556 i> upgrade * proto=exp-ssh-v2-0001\n (glob)
1574 i> write(9) -> 9: bookmarks 1574 i> write(9) -> 9: bookmarks
1575 i> flush() -> None 1575 i> flush() -> None
1576 o> bufferedreadline() -> 3: 1576 o> bufferedreadline() -> 3:
1577 o> 93\n 1577 o> 93\n
1578 o> bufferedread(93) -> 93: 1578 o> bufferedread(93) -> 93:
1579 o> bookA 68986213bd4485ea51533535e3fc9e78007a711f\n 1579 o> bookA\t68986213bd4485ea51533535e3fc9e78007a711f\n
1580 o> bookB 1880f3755e2e52e3199e0ee5638128b08642f34d 1580 o> bookB\t1880f3755e2e52e3199e0ee5638128b08642f34d
1581 response: b'bookA 68986213bd4485ea51533535e3fc9e78007a711f\nbookB 1880f3755e2e52e3199e0ee5638128b08642f34d' 1581 response: b'bookA\t68986213bd4485ea51533535e3fc9e78007a711f\nbookB\t1880f3755e2e52e3199e0ee5638128b08642f34d'
1582 1582
1583 Test pushkey for bookmarks 1583 Test pushkey for bookmarks
1584 1584
1585 $ debugwireproto << EOF 1585 $ debugwireproto << EOF
1586 > command pushkey 1586 > command pushkey
1704 i> namespace 6\n 1704 i> namespace 6\n
1705 i> write(6) -> 6: phases 1705 i> write(6) -> 6: phases
1706 i> flush() -> None 1706 i> flush() -> None
1707 o> bufferedreadline() -> 3: 1707 o> bufferedreadline() -> 3:
1708 o> 15\n 1708 o> 15\n
1709 o> bufferedread(15) -> 15: publishing True 1709 o> bufferedread(15) -> 15: publishing\tTrue
1710 response: b'publishing True' 1710 response: b'publishing\tTrue'
1711 1711
1712 testing ssh2 1712 testing ssh2
1713 creating ssh peer from handshake results 1713 creating ssh peer from handshake results
1714 i> write(171) -> 171: 1714 i> write(171) -> 171:
1715 i> upgrade * proto=exp-ssh-v2-0001\n (glob) 1715 i> upgrade * proto=exp-ssh-v2-0001\n (glob)
1732 i> namespace 6\n 1732 i> namespace 6\n
1733 i> write(6) -> 6: phases 1733 i> write(6) -> 6: phases
1734 i> flush() -> None 1734 i> flush() -> None
1735 o> bufferedreadline() -> 3: 1735 o> bufferedreadline() -> 3:
1736 o> 15\n 1736 o> 15\n
1737 o> bufferedread(15) -> 15: publishing True 1737 o> bufferedread(15) -> 15: publishing\tTrue
1738 response: b'publishing True' 1738 response: b'publishing\tTrue'
1739 1739
1740 Create some commits 1740 Create some commits
1741 1741
1742 $ echo 0 > foo 1742 $ echo 0 > foo
1743 $ hg add foo 1743 $ hg add foo
1784 i> write(6) -> 6: phases 1784 i> write(6) -> 6: phases
1785 i> flush() -> None 1785 i> flush() -> None
1786 o> bufferedreadline() -> 4: 1786 o> bufferedreadline() -> 4:
1787 o> 101\n 1787 o> 101\n
1788 o> bufferedread(101) -> 101: 1788 o> bufferedread(101) -> 101:
1789 o> 20b8a89289d80036e6c4e87c2083e3bea1586637 1\n 1789 o> 20b8a89289d80036e6c4e87c2083e3bea1586637\t1\n
1790 o> c4750011d906c18ea2f0527419cbc1a544435150 1\n 1790 o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n
1791 o> publishing True 1791 o> publishing\tTrue
1792 response: b'20b8a89289d80036e6c4e87c2083e3bea1586637 1\nc4750011d906c18ea2f0527419cbc1a544435150 1\npublishing True' 1792 response: b'20b8a89289d80036e6c4e87c2083e3bea1586637\t1\nc4750011d906c18ea2f0527419cbc1a544435150\t1\npublishing\tTrue'
1793 1793
1794 testing ssh2 1794 testing ssh2
1795 creating ssh peer from handshake results 1795 creating ssh peer from handshake results
1796 i> write(171) -> 171: 1796 i> write(171) -> 171:
1797 i> upgrade * proto=exp-ssh-v2-0001\n (glob) 1797 i> upgrade * proto=exp-ssh-v2-0001\n (glob)
1815 i> write(6) -> 6: phases 1815 i> write(6) -> 6: phases
1816 i> flush() -> None 1816 i> flush() -> None
1817 o> bufferedreadline() -> 4: 1817 o> bufferedreadline() -> 4:
1818 o> 101\n 1818 o> 101\n
1819 o> bufferedread(101) -> 101: 1819 o> bufferedread(101) -> 101:
1820 o> 20b8a89289d80036e6c4e87c2083e3bea1586637 1\n 1820 o> 20b8a89289d80036e6c4e87c2083e3bea1586637\t1\n
1821 o> c4750011d906c18ea2f0527419cbc1a544435150 1\n 1821 o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n
1822 o> publishing True 1822 o> publishing\tTrue
1823 response: b'20b8a89289d80036e6c4e87c2083e3bea1586637 1\nc4750011d906c18ea2f0527419cbc1a544435150 1\npublishing True' 1823 response: b'20b8a89289d80036e6c4e87c2083e3bea1586637\t1\nc4750011d906c18ea2f0527419cbc1a544435150\t1\npublishing\tTrue'
1824 1824
1825 Single draft head 1825 Single draft head
1826 1826
1827 $ hg phase --public -r 2 1827 $ hg phase --public -r 2
1828 $ debugwireproto << EOF 1828 $ debugwireproto << EOF
1853 i> write(6) -> 6: phases 1853 i> write(6) -> 6: phases
1854 i> flush() -> None 1854 i> flush() -> None
1855 o> bufferedreadline() -> 3: 1855 o> bufferedreadline() -> 3:
1856 o> 58\n 1856 o> 58\n
1857 o> bufferedread(58) -> 58: 1857 o> bufferedread(58) -> 58:
1858 o> c4750011d906c18ea2f0527419cbc1a544435150 1\n 1858 o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n
1859 o> publishing True 1859 o> publishing\tTrue
1860 response: b'c4750011d906c18ea2f0527419cbc1a544435150 1\npublishing True' 1860 response: b'c4750011d906c18ea2f0527419cbc1a544435150\t1\npublishing\tTrue'
1861 1861
1862 testing ssh2 1862 testing ssh2
1863 creating ssh peer from handshake results 1863 creating ssh peer from handshake results
1864 i> write(171) -> 171: 1864 i> write(171) -> 171:
1865 i> upgrade * proto=exp-ssh-v2-0001\n (glob) 1865 i> upgrade * proto=exp-ssh-v2-0001\n (glob)
1883 i> write(6) -> 6: phases 1883 i> write(6) -> 6: phases
1884 i> flush() -> None 1884 i> flush() -> None
1885 o> bufferedreadline() -> 3: 1885 o> bufferedreadline() -> 3:
1886 o> 58\n 1886 o> 58\n
1887 o> bufferedread(58) -> 58: 1887 o> bufferedread(58) -> 58:
1888 o> c4750011d906c18ea2f0527419cbc1a544435150 1\n 1888 o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n
1889 o> publishing True 1889 o> publishing\tTrue
1890 response: b'c4750011d906c18ea2f0527419cbc1a544435150 1\npublishing True' 1890 response: b'c4750011d906c18ea2f0527419cbc1a544435150\t1\npublishing\tTrue'
1891 1891
1892 All public heads 1892 All public heads
1893 1893
1894 $ hg phase --public -r 4 1894 $ hg phase --public -r 4
1895 $ debugwireproto << EOF 1895 $ debugwireproto << EOF
1919 i> namespace 6\n 1919 i> namespace 6\n
1920 i> write(6) -> 6: phases 1920 i> write(6) -> 6: phases
1921 i> flush() -> None 1921 i> flush() -> None
1922 o> bufferedreadline() -> 3: 1922 o> bufferedreadline() -> 3:
1923 o> 15\n 1923 o> 15\n
1924 o> bufferedread(15) -> 15: publishing True 1924 o> bufferedread(15) -> 15: publishing\tTrue
1925 response: b'publishing True' 1925 response: b'publishing\tTrue'
1926 1926
1927 testing ssh2 1927 testing ssh2
1928 creating ssh peer from handshake results 1928 creating ssh peer from handshake results
1929 i> write(171) -> 171: 1929 i> write(171) -> 171:
1930 i> upgrade * proto=exp-ssh-v2-0001\n (glob) 1930 i> upgrade * proto=exp-ssh-v2-0001\n (glob)
1947 i> namespace 6\n 1947 i> namespace 6\n
1948 i> write(6) -> 6: phases 1948 i> write(6) -> 6: phases
1949 i> flush() -> None 1949 i> flush() -> None
1950 o> bufferedreadline() -> 3: 1950 o> bufferedreadline() -> 3:
1951 o> 15\n 1951 o> 15\n
1952 o> bufferedread(15) -> 15: publishing True 1952 o> bufferedread(15) -> 15: publishing\tTrue
1953 response: b'publishing True' 1953 response: b'publishing\tTrue'
1954 1954
1955 Setting public phase via pushkey 1955 Setting public phase via pushkey
1956 1956
1957 $ hg phase --draft --force -r . 1957 $ hg phase --draft --force -r .
1958 1958
2097 i> flush() -> None 2097 i> flush() -> None
2098 o> bufferedreadline() -> 4: 2098 o> bufferedreadline() -> 4:
2099 o> 278\n 2099 o> 278\n
2100 o> bufferedread(278) -> 278: 2100 o> bufferedread(278) -> 278:
2101 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n 2101 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
2102 o> ;bookA 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n 2102 o> ;bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
2103 o> bookB bfebe6bd38eebc6f8202e419c1171268987ea6a6;4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab 1\n 2103 o> bookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6;4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\n
2104 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 1\n 2104 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\n
2105 o> publishing True 2105 o> publishing\tTrue
2106 response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n 2106 response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
2107 response #1: bookA 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB bfebe6bd38eebc6f8202e419c1171268987ea6a6 2107 response #1: bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6
2108 response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab 1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6 1\npublishing True 2108 response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\npublishing\tTrue
2109 2109
2110 testing ssh2 2110 testing ssh2
2111 creating ssh peer from handshake results 2111 creating ssh peer from handshake results
2112 i> write(171) -> 171: 2112 i> write(171) -> 171:
2113 i> upgrade * proto=exp-ssh-v2-0001\n (glob) 2113 i> upgrade * proto=exp-ssh-v2-0001\n (glob)
2134 i> flush() -> None 2134 i> flush() -> None
2135 o> bufferedreadline() -> 4: 2135 o> bufferedreadline() -> 4:
2136 o> 278\n 2136 o> 278\n
2137 o> bufferedread(278) -> 278: 2137 o> bufferedread(278) -> 278:
2138 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n 2138 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
2139 o> ;bookA 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n 2139 o> ;bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
2140 o> bookB bfebe6bd38eebc6f8202e419c1171268987ea6a6;4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab 1\n 2140 o> bookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6;4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\n
2141 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 1\n 2141 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\n
2142 o> publishing True 2142 o> publishing\tTrue
2143 response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n 2143 response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
2144 response #1: bookA 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB bfebe6bd38eebc6f8202e419c1171268987ea6a6 2144 response #1: bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6
2145 response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab 1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6 1\npublishing True 2145 response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\npublishing\tTrue