Show More
The requested changes are too big and content was truncated. Show full diff
@@ -1102,16 +1102,6 b' coreconfigitem(' | |||||
1102 | ) |
|
1102 | ) | |
1103 | coreconfigitem( |
|
1103 | coreconfigitem( | |
1104 | b'experimental', |
|
1104 | b'experimental', | |
1105 | b'httppeer.advertise-v2', |
|
|||
1106 | default=False, |
|
|||
1107 | ) |
|
|||
1108 | coreconfigitem( |
|
|||
1109 | b'experimental', |
|
|||
1110 | b'httppeer.v2-encoder-order', |
|
|||
1111 | default=None, |
|
|||
1112 | ) |
|
|||
1113 | coreconfigitem( |
|
|||
1114 | b'experimental', |
|
|||
1115 | b'httppostargs', |
|
1105 | b'httppostargs', | |
1116 | default=False, |
|
1106 | default=False, | |
1117 | ) |
|
1107 | ) | |
@@ -1211,11 +1201,6 b' coreconfigitem(' | |||||
1211 | ) |
|
1201 | ) | |
1212 | coreconfigitem( |
|
1202 | coreconfigitem( | |
1213 | b'experimental', |
|
1203 | b'experimental', | |
1214 | b'sshserver.support-v2', |
|
|||
1215 | default=False, |
|
|||
1216 | ) |
|
|||
1217 | coreconfigitem( |
|
|||
1218 | b'experimental', |
|
|||
1219 | b'sparse-read', |
|
1204 | b'sparse-read', | |
1220 | default=False, |
|
1205 | default=False, | |
1221 | ) |
|
1206 | ) | |
@@ -1241,26 +1226,6 b' coreconfigitem(' | |||||
1241 | ) |
|
1226 | ) | |
1242 | coreconfigitem( |
|
1227 | coreconfigitem( | |
1243 | b'experimental', |
|
1228 | b'experimental', | |
1244 | b'sshpeer.advertise-v2', |
|
|||
1245 | default=False, |
|
|||
1246 | ) |
|
|||
1247 | coreconfigitem( |
|
|||
1248 | b'experimental', |
|
|||
1249 | b'web.apiserver', |
|
|||
1250 | default=False, |
|
|||
1251 | ) |
|
|||
1252 | coreconfigitem( |
|
|||
1253 | b'experimental', |
|
|||
1254 | b'web.api.http-v2', |
|
|||
1255 | default=False, |
|
|||
1256 | ) |
|
|||
1257 | coreconfigitem( |
|
|||
1258 | b'experimental', |
|
|||
1259 | b'web.api.debugreflect', |
|
|||
1260 | default=False, |
|
|||
1261 | ) |
|
|||
1262 | coreconfigitem( |
|
|||
1263 | b'experimental', |
|
|||
1264 | b'web.full-garbage-collection-rate', |
|
1229 | b'web.full-garbage-collection-rate', | |
1265 | default=1, # still forcing a full collection on each request |
|
1230 | default=1, # still forcing a full collection on each request | |
1266 | ) |
|
1231 | ) |
@@ -91,7 +91,6 b' from . import (' | |||||
91 | vfs as vfsmod, |
|
91 | vfs as vfsmod, | |
92 | wireprotoframing, |
|
92 | wireprotoframing, | |
93 | wireprotoserver, |
|
93 | wireprotoserver, | |
94 | wireprotov2peer, |
|
|||
95 | ) |
|
94 | ) | |
96 | from .interfaces import repository |
|
95 | from .interfaces import repository | |
97 | from .utils import ( |
|
96 | from .utils import ( | |
@@ -4352,8 +4351,8 b' def debugwireproto(ui, repo, path=None, ' | |||||
4352 |
|
4351 | |||
4353 | ``--peer`` can be used to bypass the handshake protocol and construct a |
|
4352 | ``--peer`` can be used to bypass the handshake protocol and construct a | |
4354 | peer instance using the specified class type. Valid values are ``raw``, |
|
4353 | peer instance using the specified class type. Valid values are ``raw``, | |
4355 |
`` |
|
4354 | ``ssh1``. ``raw`` instances only allow sending raw data payloads and | |
4356 |
|
|
4355 | don't support higher-level command actions. | |
4357 |
|
4356 | |||
4358 | ``--noreadstderr`` can be used to disable automatic reading from stderr |
|
4357 | ``--noreadstderr`` can be used to disable automatic reading from stderr | |
4359 | of the peer (for SSH connections only). Disabling automatic reading of |
|
4358 | of the peer (for SSH connections only). Disabling automatic reading of | |
@@ -4528,13 +4527,11 b' def debugwireproto(ui, repo, path=None, ' | |||||
4528 |
|
4527 | |||
4529 | if opts[b'peer'] and opts[b'peer'] not in ( |
|
4528 | if opts[b'peer'] and opts[b'peer'] not in ( | |
4530 | b'raw', |
|
4529 | b'raw', | |
4531 | b'http2', |
|
|||
4532 | b'ssh1', |
|
4530 | b'ssh1', | |
4533 | b'ssh2', |
|
|||
4534 | ): |
|
4531 | ): | |
4535 | raise error.Abort( |
|
4532 | raise error.Abort( | |
4536 | _(b'invalid value for --peer'), |
|
4533 | _(b'invalid value for --peer'), | |
4537 |
hint=_(b'valid values are "raw" |
|
4534 | hint=_(b'valid values are "raw" and "ssh1"'), | |
4538 | ) |
|
4535 | ) | |
4539 |
|
4536 | |||
4540 | if path and opts[b'localssh']: |
|
4537 | if path and opts[b'localssh']: | |
@@ -4602,18 +4599,6 b' def debugwireproto(ui, repo, path=None, ' | |||||
4602 | None, |
|
4599 | None, | |
4603 | autoreadstderr=autoreadstderr, |
|
4600 | autoreadstderr=autoreadstderr, | |
4604 | ) |
|
4601 | ) | |
4605 | elif opts[b'peer'] == b'ssh2': |
|
|||
4606 | ui.write(_(b'creating ssh peer for wire protocol version 2\n')) |
|
|||
4607 | peer = sshpeer.sshv2peer( |
|
|||
4608 | ui, |
|
|||
4609 | url, |
|
|||
4610 | proc, |
|
|||
4611 | stdin, |
|
|||
4612 | stdout, |
|
|||
4613 | stderr, |
|
|||
4614 | None, |
|
|||
4615 | autoreadstderr=autoreadstderr, |
|
|||
4616 | ) |
|
|||
4617 | elif opts[b'peer'] == b'raw': |
|
4602 | elif opts[b'peer'] == b'raw': | |
4618 | ui.write(_(b'using raw connection to peer\n')) |
|
4603 | ui.write(_(b'using raw connection to peer\n')) | |
4619 | peer = None |
|
4604 | peer = None | |
@@ -4666,34 +4651,7 b' def debugwireproto(ui, repo, path=None, ' | |||||
4666 |
|
4651 | |||
4667 | opener = urlmod.opener(ui, authinfo, **openerargs) |
|
4652 | opener = urlmod.opener(ui, authinfo, **openerargs) | |
4668 |
|
4653 | |||
4669 |
if opts[b'peer'] == b' |
|
4654 | if opts[b'peer'] == b'raw': | |
4670 | ui.write(_(b'creating http peer for wire protocol version 2\n')) |
|
|||
4671 | # We go through makepeer() because we need an API descriptor for |
|
|||
4672 | # the peer instance to be useful. |
|
|||
4673 | maybe_silent = ( |
|
|||
4674 | ui.silent() |
|
|||
4675 | if opts[b'nologhandshake'] |
|
|||
4676 | else util.nullcontextmanager() |
|
|||
4677 | ) |
|
|||
4678 | with maybe_silent, ui.configoverride( |
|
|||
4679 | {(b'experimental', b'httppeer.advertise-v2'): True} |
|
|||
4680 | ): |
|
|||
4681 | peer = httppeer.makepeer(ui, path, opener=opener) |
|
|||
4682 |
|
||||
4683 | if not isinstance(peer, httppeer.httpv2peer): |
|
|||
4684 | raise error.Abort( |
|
|||
4685 | _( |
|
|||
4686 | b'could not instantiate HTTP peer for ' |
|
|||
4687 | b'wire protocol version 2' |
|
|||
4688 | ), |
|
|||
4689 | hint=_( |
|
|||
4690 | b'the server may not have the feature ' |
|
|||
4691 | b'enabled or is not allowing this ' |
|
|||
4692 | b'client version' |
|
|||
4693 | ), |
|
|||
4694 | ) |
|
|||
4695 |
|
||||
4696 | elif opts[b'peer'] == b'raw': |
|
|||
4697 | ui.write(_(b'using raw connection to peer\n')) |
|
4655 | ui.write(_(b'using raw connection to peer\n')) | |
4698 | peer = None |
|
4656 | peer = None | |
4699 | elif opts[b'peer']: |
|
4657 | elif opts[b'peer']: | |
@@ -4774,17 +4732,10 b' def debugwireproto(ui, repo, path=None, ' | |||||
4774 | with peer.commandexecutor() as e: |
|
4732 | with peer.commandexecutor() as e: | |
4775 | res = e.callcommand(command, args).result() |
|
4733 | res = e.callcommand(command, args).result() | |
4776 |
|
4734 | |||
4777 | if isinstance(res, wireprotov2peer.commandresponse): |
|
4735 | ui.status( | |
4778 |
|
|
4736 | _(b'response: %s\n') | |
4779 | ui.status( |
|
4737 | % stringutil.pprint(res, bprefix=True, indent=2) | |
4780 | _(b'response: %s\n') |
|
4738 | ) | |
4781 | % stringutil.pprint(val, bprefix=True, indent=2) |
|
|||
4782 | ) |
|
|||
4783 | else: |
|
|||
4784 | ui.status( |
|
|||
4785 | _(b'response: %s\n') |
|
|||
4786 | % stringutil.pprint(res, bprefix=True, indent=2) |
|
|||
4787 | ) |
|
|||
4788 |
|
4739 | |||
4789 | elif action == b'batchbegin': |
|
4740 | elif action == b'batchbegin': | |
4790 | if batchedcommands is not None: |
|
4741 | if batchedcommands is not None: |
@@ -22,7 +22,6 b' from . import (' | |||||
22 | changegroup, |
|
22 | changegroup, | |
23 | discovery, |
|
23 | discovery, | |
24 | error, |
|
24 | error, | |
25 | exchangev2, |
|
|||
26 | lock as lockmod, |
|
25 | lock as lockmod, | |
27 | logexchange, |
|
26 | logexchange, | |
28 | narrowspec, |
|
27 | narrowspec, | |
@@ -1666,21 +1665,17 b' def pull(' | |||||
1666 | ): |
|
1665 | ): | |
1667 | add_confirm_callback(repo, pullop) |
|
1666 | add_confirm_callback(repo, pullop) | |
1668 |
|
1667 | |||
1669 | # Use the modern wire protocol, if available. |
|
1668 | # This should ideally be in _pullbundle2(). However, it needs to run | |
1670 | if remote.capable(b'command-changesetdata'): |
|
1669 | # before discovery to avoid extra work. | |
1671 |
|
|
1670 | _maybeapplyclonebundle(pullop) | |
1672 | else: |
|
1671 | streamclone.maybeperformlegacystreamclone(pullop) | |
1673 | # This should ideally be in _pullbundle2(). However, it needs to run |
|
1672 | _pulldiscovery(pullop) | |
1674 | # before discovery to avoid extra work. |
|
1673 | if pullop.canusebundle2: | |
1675 |
_ |
|
1674 | _fullpullbundle2(repo, pullop) | |
1676 | streamclone.maybeperformlegacystreamclone(pullop) |
|
1675 | _pullchangeset(pullop) | |
1677 |
|
|
1676 | _pullphase(pullop) | |
1678 | if pullop.canusebundle2: |
|
1677 | _pullbookmarks(pullop) | |
1679 |
|
|
1678 | _pullobsolete(pullop) | |
1680 | _pullchangeset(pullop) |
|
|||
1681 | _pullphase(pullop) |
|
|||
1682 | _pullbookmarks(pullop) |
|
|||
1683 | _pullobsolete(pullop) |
|
|||
1684 |
|
1679 | |||
1685 | # storing remotenames |
|
1680 | # storing remotenames | |
1686 | if repo.ui.configbool(b'experimental', b'remotenames'): |
|
1681 | if repo.ui.configbool(b'experimental', b'remotenames'): |
@@ -332,95 +332,6 b' part of the response payload and not par' | |||||
332 | after responses. In other words, the length of the response contains the |
|
332 | after responses. In other words, the length of the response contains the | |
333 | trailing ``\n``. |
|
333 | trailing ``\n``. | |
334 |
|
334 | |||
335 | Clients supporting version 2 of the SSH transport send a line beginning |
|
|||
336 | with ``upgrade`` before the ``hello`` and ``between`` commands. The line |
|
|||
337 | (which isn't a well-formed command line because it doesn't consist of a |
|
|||
338 | single command name) serves to both communicate the client's intent to |
|
|||
339 | switch to transport version 2 (transports are version 1 by default) as |
|
|||
340 | well as to advertise the client's transport-level capabilities so the |
|
|||
341 | server may satisfy that request immediately. |
|
|||
342 |
|
||||
343 | The upgrade line has the form: |
|
|||
344 |
|
||||
345 | upgrade <token> <transport capabilities> |
|
|||
346 |
|
||||
347 | That is the literal string ``upgrade`` followed by a space, followed by |
|
|||
348 | a randomly generated string, followed by a space, followed by a string |
|
|||
349 | denoting the client's transport capabilities. |
|
|||
350 |
|
||||
351 | The token can be anything. However, a random UUID is recommended. (Use |
|
|||
352 | of version 4 UUIDs is recommended because version 1 UUIDs can leak the |
|
|||
353 | client's MAC address.) |
|
|||
354 |
|
||||
355 | The transport capabilities string is a URL/percent encoded string |
|
|||
356 | containing key-value pairs defining the client's transport-level |
|
|||
357 | capabilities. The following capabilities are defined: |
|
|||
358 |
|
||||
359 | proto |
|
|||
360 | A comma-delimited list of transport protocol versions the client |
|
|||
361 | supports. e.g. ``ssh-v2``. |
|
|||
362 |
|
||||
363 | If the server does not recognize the ``upgrade`` line, it should issue |
|
|||
364 | an empty response and continue processing the ``hello`` and ``between`` |
|
|||
365 | commands. Here is an example handshake between a version 2 aware client |
|
|||
366 | and a non version 2 aware server: |
|
|||
367 |
|
||||
368 | c: upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=ssh-v2 |
|
|||
369 | c: hello\n |
|
|||
370 | c: between\n |
|
|||
371 | c: pairs 81\n |
|
|||
372 | c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
373 | s: 0\n |
|
|||
374 | s: 324\n |
|
|||
375 | s: capabilities: lookup changegroupsubset branchmap pushkey known getbundle ...\n |
|
|||
376 | s: 1\n |
|
|||
377 | s: \n |
|
|||
378 |
|
||||
379 | (The initial ``0\n`` line from the server indicates an empty response to |
|
|||
380 | the unknown ``upgrade ..`` command/line.) |
|
|||
381 |
|
||||
382 | If the server recognizes the ``upgrade`` line and is willing to satisfy that |
|
|||
383 | upgrade request, it replies to with a payload of the following form: |
|
|||
384 |
|
||||
385 | upgraded <token> <transport name>\n |
|
|||
386 |
|
||||
387 | This line is the literal string ``upgraded``, a space, the token that was |
|
|||
388 | specified by the client in its ``upgrade ...`` request line, a space, and the |
|
|||
389 | name of the transport protocol that was chosen by the server. The transport |
|
|||
390 | name MUST match one of the names the client specified in the ``proto`` field |
|
|||
391 | of its ``upgrade ...`` request line. |
|
|||
392 |
|
||||
393 | If a server issues an ``upgraded`` response, it MUST also read and ignore |
|
|||
394 | the lines associated with the ``hello`` and ``between`` command requests |
|
|||
395 | that were issued by the server. It is assumed that the negotiated transport |
|
|||
396 | will respond with equivalent requested information following the transport |
|
|||
397 | handshake. |
|
|||
398 |
|
||||
399 | All data following the ``\n`` terminating the ``upgraded`` line is the |
|
|||
400 | domain of the negotiated transport. It is common for the data immediately |
|
|||
401 | following to contain additional metadata about the state of the transport and |
|
|||
402 | the server. However, this isn't strictly speaking part of the transport |
|
|||
403 | handshake and isn't covered by this section. |
|
|||
404 |
|
||||
405 | Here is an example handshake between a version 2 aware client and a version |
|
|||
406 | 2 aware server: |
|
|||
407 |
|
||||
408 | c: upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=ssh-v2 |
|
|||
409 | c: hello\n |
|
|||
410 | c: between\n |
|
|||
411 | c: pairs 81\n |
|
|||
412 | c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
413 | s: upgraded 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a ssh-v2\n |
|
|||
414 | s: <additional transport specific data> |
|
|||
415 |
|
||||
416 | The client-issued token that is echoed in the response provides a more |
|
|||
417 | resilient mechanism for differentiating *banner* output from Mercurial |
|
|||
418 | output. In version 1, properly formatted banner output could get confused |
|
|||
419 | for Mercurial server output. By submitting a randomly generated token |
|
|||
420 | that is then present in the response, the client can look for that token |
|
|||
421 | in response lines and have reasonable certainty that the line did not |
|
|||
422 | originate from a *banner* message. |
|
|||
423 |
|
||||
424 | SSH Version 1 Transport |
|
335 | SSH Version 1 Transport | |
425 | ----------------------- |
|
336 | ----------------------- | |
426 |
|
337 | |||
@@ -488,31 +399,6 b' If the server announces support for the ' | |||||
488 | should issue a ``protocaps`` command after the initial handshake to annonunce |
|
399 | should issue a ``protocaps`` command after the initial handshake to annonunce | |
489 | its own capabilities. The client capabilities are persistent. |
|
400 | its own capabilities. The client capabilities are persistent. | |
490 |
|
401 | |||
491 | SSH Version 2 Transport |
|
|||
492 | ----------------------- |
|
|||
493 |
|
||||
494 | **Experimental and under development** |
|
|||
495 |
|
||||
496 | Version 2 of the SSH transport behaves identically to version 1 of the SSH |
|
|||
497 | transport with the exception of handshake semantics. See above for how |
|
|||
498 | version 2 of the SSH transport is negotiated. |
|
|||
499 |
|
||||
500 | Immediately following the ``upgraded`` line signaling a switch to version |
|
|||
501 | 2 of the SSH protocol, the server automatically sends additional details |
|
|||
502 | about the capabilities of the remote server. This has the form: |
|
|||
503 |
|
||||
504 | <integer length of value>\n |
|
|||
505 | capabilities: ...\n |
|
|||
506 |
|
||||
507 | e.g. |
|
|||
508 |
|
||||
509 | s: upgraded 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a ssh-v2\n |
|
|||
510 | s: 240\n |
|
|||
511 | s: capabilities: known getbundle batch ...\n |
|
|||
512 |
|
||||
513 | Following capabilities advertisement, the peers communicate using version |
|
|||
514 | 1 of the SSH transport. |
|
|||
515 |
|
||||
516 | Capabilities |
|
402 | Capabilities | |
517 | ============ |
|
403 | ============ | |
518 |
|
404 |
@@ -366,17 +366,6 b' class hgweb(object):' | |||||
366 | # replace it. |
|
366 | # replace it. | |
367 | res.headers[b'Content-Security-Policy'] = rctx.csp |
|
367 | res.headers[b'Content-Security-Policy'] = rctx.csp | |
368 |
|
368 | |||
369 | # /api/* is reserved for various API implementations. Dispatch |
|
|||
370 | # accordingly. But URL paths can conflict with subrepos and virtual |
|
|||
371 | # repos in hgwebdir. So until we have a workaround for this, only |
|
|||
372 | # expose the URLs if the feature is enabled. |
|
|||
373 | apienabled = rctx.repo.ui.configbool(b'experimental', b'web.apiserver') |
|
|||
374 | if apienabled and req.dispatchparts and req.dispatchparts[0] == b'api': |
|
|||
375 | wireprotoserver.handlewsgiapirequest( |
|
|||
376 | rctx, req, res, self.check_perm |
|
|||
377 | ) |
|
|||
378 | return res.sendresponse() |
|
|||
379 |
|
||||
380 | handled = wireprotoserver.handlewsgirequest( |
|
369 | handled = wireprotoserver.handlewsgirequest( | |
381 | rctx, req, res, self.check_perm |
|
370 | rctx, req, res, self.check_perm | |
382 | ) |
|
371 | ) |
@@ -13,7 +13,6 b' import io' | |||||
13 | import os |
|
13 | import os | |
14 | import socket |
|
14 | import socket | |
15 | import struct |
|
15 | import struct | |
16 | import weakref |
|
|||
17 |
|
16 | |||
18 | from .i18n import _ |
|
17 | from .i18n import _ | |
19 | from .pycompat import getattr |
|
18 | from .pycompat import getattr | |
@@ -25,21 +24,9 b' from . import (' | |||||
25 | statichttprepo, |
|
24 | statichttprepo, | |
26 | url as urlmod, |
|
25 | url as urlmod, | |
27 | util, |
|
26 | util, | |
28 | wireprotoframing, |
|
|||
29 | wireprototypes, |
|
|||
30 | wireprotov1peer, |
|
27 | wireprotov1peer, | |
31 | wireprotov2peer, |
|
|||
32 | wireprotov2server, |
|
|||
33 | ) |
|
28 | ) | |
34 |
from . |
|
29 | from .utils import urlutil | |
35 | repository, |
|
|||
36 | util as interfaceutil, |
|
|||
37 | ) |
|
|||
38 | from .utils import ( |
|
|||
39 | cborutil, |
|
|||
40 | stringutil, |
|
|||
41 | urlutil, |
|
|||
42 | ) |
|
|||
43 |
|
30 | |||
44 | httplib = util.httplib |
|
31 | httplib = util.httplib | |
45 | urlerr = util.urlerr |
|
32 | urlerr = util.urlerr | |
@@ -331,9 +318,7 b' class RedirectedRepoError(error.RepoErro' | |||||
331 | self.respurl = respurl |
|
318 | self.respurl = respurl | |
332 |
|
319 | |||
333 |
|
320 | |||
334 | def parsev1commandresponse( |
|
321 | def parsev1commandresponse(ui, baseurl, requrl, qs, resp, compressible): | |
335 | ui, baseurl, requrl, qs, resp, compressible, allowcbor=False |
|
|||
336 | ): |
|
|||
337 | # record the url we got redirected to |
|
322 | # record the url we got redirected to | |
338 | redirected = False |
|
323 | redirected = False | |
339 | respurl = pycompat.bytesurl(resp.geturl()) |
|
324 | respurl = pycompat.bytesurl(resp.geturl()) | |
@@ -376,17 +361,6 b' def parsev1commandresponse(' | |||||
376 | try: |
|
361 | try: | |
377 | subtype = proto.split(b'-', 1)[1] |
|
362 | subtype = proto.split(b'-', 1)[1] | |
378 |
|
363 | |||
379 | # Unless we end up supporting CBOR in the legacy wire protocol, |
|
|||
380 | # this should ONLY be encountered for the initial capabilities |
|
|||
381 | # request during handshake. |
|
|||
382 | if subtype == b'cbor': |
|
|||
383 | if allowcbor: |
|
|||
384 | return respurl, proto, resp |
|
|||
385 | else: |
|
|||
386 | raise error.RepoError( |
|
|||
387 | _(b'unexpected CBOR response from server') |
|
|||
388 | ) |
|
|||
389 |
|
||||
390 | version_info = tuple([int(n) for n in subtype.split(b'.')]) |
|
364 | version_info = tuple([int(n) for n in subtype.split(b'.')]) | |
391 | except ValueError: |
|
365 | except ValueError: | |
392 | raise error.RepoError( |
|
366 | raise error.RepoError( | |
@@ -564,85 +538,6 b' class httppeer(wireprotov1peer.wirepeer)' | |||||
564 | raise exception |
|
538 | raise exception | |
565 |
|
539 | |||
566 |
|
540 | |||
567 | def sendv2request( |
|
|||
568 | ui, opener, requestbuilder, apiurl, permission, requests, redirect |
|
|||
569 | ): |
|
|||
570 | wireprotoframing.populatestreamencoders() |
|
|||
571 |
|
||||
572 | uiencoders = ui.configlist(b'experimental', b'httppeer.v2-encoder-order') |
|
|||
573 |
|
||||
574 | if uiencoders: |
|
|||
575 | encoders = [] |
|
|||
576 |
|
||||
577 | for encoder in uiencoders: |
|
|||
578 | if encoder not in wireprotoframing.STREAM_ENCODERS: |
|
|||
579 | ui.warn( |
|
|||
580 | _( |
|
|||
581 | b'wire protocol version 2 encoder referenced in ' |
|
|||
582 | b'config (%s) is not known; ignoring\n' |
|
|||
583 | ) |
|
|||
584 | % encoder |
|
|||
585 | ) |
|
|||
586 | else: |
|
|||
587 | encoders.append(encoder) |
|
|||
588 |
|
||||
589 | else: |
|
|||
590 | encoders = wireprotoframing.STREAM_ENCODERS_ORDER |
|
|||
591 |
|
||||
592 | reactor = wireprotoframing.clientreactor( |
|
|||
593 | ui, |
|
|||
594 | hasmultiplesend=False, |
|
|||
595 | buffersends=True, |
|
|||
596 | clientcontentencoders=encoders, |
|
|||
597 | ) |
|
|||
598 |
|
||||
599 | handler = wireprotov2peer.clienthandler( |
|
|||
600 | ui, reactor, opener=opener, requestbuilder=requestbuilder |
|
|||
601 | ) |
|
|||
602 |
|
||||
603 | url = b'%s/%s' % (apiurl, permission) |
|
|||
604 |
|
||||
605 | if len(requests) > 1: |
|
|||
606 | url += b'/multirequest' |
|
|||
607 | else: |
|
|||
608 | url += b'/%s' % requests[0][0] |
|
|||
609 |
|
||||
610 | ui.debug(b'sending %d commands\n' % len(requests)) |
|
|||
611 | for command, args, f in requests: |
|
|||
612 | ui.debug( |
|
|||
613 | b'sending command %s: %s\n' |
|
|||
614 | % (command, stringutil.pprint(args, indent=2)) |
|
|||
615 | ) |
|
|||
616 | assert not list( |
|
|||
617 | handler.callcommand(command, args, f, redirect=redirect) |
|
|||
618 | ) |
|
|||
619 |
|
||||
620 | # TODO stream this. |
|
|||
621 | body = b''.join(map(bytes, handler.flushcommands())) |
|
|||
622 |
|
||||
623 | # TODO modify user-agent to reflect v2 |
|
|||
624 | headers = { |
|
|||
625 | 'Accept': wireprotov2server.FRAMINGTYPE, |
|
|||
626 | 'Content-Type': wireprotov2server.FRAMINGTYPE, |
|
|||
627 | } |
|
|||
628 |
|
||||
629 | req = requestbuilder(pycompat.strurl(url), body, headers) |
|
|||
630 | req.add_unredirected_header('Content-Length', '%d' % len(body)) |
|
|||
631 |
|
||||
632 | try: |
|
|||
633 | res = opener.open(req) |
|
|||
634 | except urlerr.httperror as e: |
|
|||
635 | if e.code == 401: |
|
|||
636 | raise error.Abort(_(b'authorization failed')) |
|
|||
637 |
|
||||
638 | raise |
|
|||
639 | except httplib.HTTPException as e: |
|
|||
640 | ui.traceback() |
|
|||
641 | raise IOError(None, e) |
|
|||
642 |
|
||||
643 | return handler, res |
|
|||
644 |
|
||||
645 |
|
||||
646 | class queuedcommandfuture(pycompat.futures.Future): |
|
541 | class queuedcommandfuture(pycompat.futures.Future): | |
647 | """Wraps result() on command futures to trigger submission on call.""" |
|
542 | """Wraps result() on command futures to trigger submission on call.""" | |
648 |
|
543 | |||
@@ -657,302 +552,6 b' class queuedcommandfuture(pycompat.futur' | |||||
657 | return self.result(timeout) |
|
552 | return self.result(timeout) | |
658 |
|
553 | |||
659 |
|
554 | |||
660 | @interfaceutil.implementer(repository.ipeercommandexecutor) |
|
|||
661 | class httpv2executor(object): |
|
|||
662 | def __init__( |
|
|||
663 | self, ui, opener, requestbuilder, apiurl, descriptor, redirect |
|
|||
664 | ): |
|
|||
665 | self._ui = ui |
|
|||
666 | self._opener = opener |
|
|||
667 | self._requestbuilder = requestbuilder |
|
|||
668 | self._apiurl = apiurl |
|
|||
669 | self._descriptor = descriptor |
|
|||
670 | self._redirect = redirect |
|
|||
671 | self._sent = False |
|
|||
672 | self._closed = False |
|
|||
673 | self._neededpermissions = set() |
|
|||
674 | self._calls = [] |
|
|||
675 | self._futures = weakref.WeakSet() |
|
|||
676 | self._responseexecutor = None |
|
|||
677 | self._responsef = None |
|
|||
678 |
|
||||
679 | def __enter__(self): |
|
|||
680 | return self |
|
|||
681 |
|
||||
682 | def __exit__(self, exctype, excvalue, exctb): |
|
|||
683 | self.close() |
|
|||
684 |
|
||||
685 | def callcommand(self, command, args): |
|
|||
686 | if self._sent: |
|
|||
687 | raise error.ProgrammingError( |
|
|||
688 | b'callcommand() cannot be used after commands are sent' |
|
|||
689 | ) |
|
|||
690 |
|
||||
691 | if self._closed: |
|
|||
692 | raise error.ProgrammingError( |
|
|||
693 | b'callcommand() cannot be used after close()' |
|
|||
694 | ) |
|
|||
695 |
|
||||
696 | # The service advertises which commands are available. So if we attempt |
|
|||
697 | # to call an unknown command or pass an unknown argument, we can screen |
|
|||
698 | # for this. |
|
|||
699 | if command not in self._descriptor[b'commands']: |
|
|||
700 | raise error.ProgrammingError( |
|
|||
701 | b'wire protocol command %s is not available' % command |
|
|||
702 | ) |
|
|||
703 |
|
||||
704 | cmdinfo = self._descriptor[b'commands'][command] |
|
|||
705 | unknownargs = set(args.keys()) - set(cmdinfo.get(b'args', {})) |
|
|||
706 |
|
||||
707 | if unknownargs: |
|
|||
708 | raise error.ProgrammingError( |
|
|||
709 | b'wire protocol command %s does not accept argument: %s' |
|
|||
710 | % (command, b', '.join(sorted(unknownargs))) |
|
|||
711 | ) |
|
|||
712 |
|
||||
713 | self._neededpermissions |= set(cmdinfo[b'permissions']) |
|
|||
714 |
|
||||
715 | # TODO we /could/ also validate types here, since the API descriptor |
|
|||
716 | # includes types... |
|
|||
717 |
|
||||
718 | f = pycompat.futures.Future() |
|
|||
719 |
|
||||
720 | # Monkeypatch it so result() triggers sendcommands(), otherwise result() |
|
|||
721 | # could deadlock. |
|
|||
722 | f.__class__ = queuedcommandfuture |
|
|||
723 | f._peerexecutor = self |
|
|||
724 |
|
||||
725 | self._futures.add(f) |
|
|||
726 | self._calls.append((command, args, f)) |
|
|||
727 |
|
||||
728 | return f |
|
|||
729 |
|
||||
730 | def sendcommands(self): |
|
|||
731 | if self._sent: |
|
|||
732 | return |
|
|||
733 |
|
||||
734 | if not self._calls: |
|
|||
735 | return |
|
|||
736 |
|
||||
737 | self._sent = True |
|
|||
738 |
|
||||
739 | # Unhack any future types so caller sees a clean type and so we |
|
|||
740 | # break reference cycle. |
|
|||
741 | for f in self._futures: |
|
|||
742 | if isinstance(f, queuedcommandfuture): |
|
|||
743 | f.__class__ = pycompat.futures.Future |
|
|||
744 | f._peerexecutor = None |
|
|||
745 |
|
||||
746 | # Mark the future as running and filter out cancelled futures. |
|
|||
747 | calls = [ |
|
|||
748 | (command, args, f) |
|
|||
749 | for command, args, f in self._calls |
|
|||
750 | if f.set_running_or_notify_cancel() |
|
|||
751 | ] |
|
|||
752 |
|
||||
753 | # Clear out references, prevent improper object usage. |
|
|||
754 | self._calls = None |
|
|||
755 |
|
||||
756 | if not calls: |
|
|||
757 | return |
|
|||
758 |
|
||||
759 | permissions = set(self._neededpermissions) |
|
|||
760 |
|
||||
761 | if b'push' in permissions and b'pull' in permissions: |
|
|||
762 | permissions.remove(b'pull') |
|
|||
763 |
|
||||
764 | if len(permissions) > 1: |
|
|||
765 | raise error.RepoError( |
|
|||
766 | _(b'cannot make request requiring multiple permissions: %s') |
|
|||
767 | % _(b', ').join(sorted(permissions)) |
|
|||
768 | ) |
|
|||
769 |
|
||||
770 | permission = { |
|
|||
771 | b'push': b'rw', |
|
|||
772 | b'pull': b'ro', |
|
|||
773 | }[permissions.pop()] |
|
|||
774 |
|
||||
775 | handler, resp = sendv2request( |
|
|||
776 | self._ui, |
|
|||
777 | self._opener, |
|
|||
778 | self._requestbuilder, |
|
|||
779 | self._apiurl, |
|
|||
780 | permission, |
|
|||
781 | calls, |
|
|||
782 | self._redirect, |
|
|||
783 | ) |
|
|||
784 |
|
||||
785 | # TODO we probably want to validate the HTTP code, media type, etc. |
|
|||
786 |
|
||||
787 | self._responseexecutor = pycompat.futures.ThreadPoolExecutor(1) |
|
|||
788 | self._responsef = self._responseexecutor.submit( |
|
|||
789 | self._handleresponse, handler, resp |
|
|||
790 | ) |
|
|||
791 |
|
||||
792 | def close(self): |
|
|||
793 | if self._closed: |
|
|||
794 | return |
|
|||
795 |
|
||||
796 | self.sendcommands() |
|
|||
797 |
|
||||
798 | self._closed = True |
|
|||
799 |
|
||||
800 | if not self._responsef: |
|
|||
801 | return |
|
|||
802 |
|
||||
803 | # TODO ^C here may not result in immediate program termination. |
|
|||
804 |
|
||||
805 | try: |
|
|||
806 | self._responsef.result() |
|
|||
807 | finally: |
|
|||
808 | self._responseexecutor.shutdown(wait=True) |
|
|||
809 | self._responsef = None |
|
|||
810 | self._responseexecutor = None |
|
|||
811 |
|
||||
812 | # If any of our futures are still in progress, mark them as |
|
|||
813 | # errored, otherwise a result() could wait indefinitely. |
|
|||
814 | for f in self._futures: |
|
|||
815 | if not f.done(): |
|
|||
816 | f.set_exception( |
|
|||
817 | error.ResponseError(_(b'unfulfilled command response')) |
|
|||
818 | ) |
|
|||
819 |
|
||||
820 | self._futures = None |
|
|||
821 |
|
||||
822 | def _handleresponse(self, handler, resp): |
|
|||
823 | # Called in a thread to read the response. |
|
|||
824 |
|
||||
825 | while handler.readdata(resp): |
|
|||
826 | pass |
|
|||
827 |
|
||||
828 |
|
||||
829 | @interfaceutil.implementer(repository.ipeerv2) |
|
|||
830 | class httpv2peer(object): |
|
|||
831 |
|
||||
832 | limitedarguments = False |
|
|||
833 |
|
||||
834 | def __init__( |
|
|||
835 | self, ui, repourl, apipath, opener, requestbuilder, apidescriptor |
|
|||
836 | ): |
|
|||
837 | self.ui = ui |
|
|||
838 | self.apidescriptor = apidescriptor |
|
|||
839 |
|
||||
840 | if repourl.endswith(b'/'): |
|
|||
841 | repourl = repourl[:-1] |
|
|||
842 |
|
||||
843 | self._url = repourl |
|
|||
844 | self._apipath = apipath |
|
|||
845 | self._apiurl = b'%s/%s' % (repourl, apipath) |
|
|||
846 | self._opener = opener |
|
|||
847 | self._requestbuilder = requestbuilder |
|
|||
848 |
|
||||
849 | self._redirect = wireprotov2peer.supportedredirects(ui, apidescriptor) |
|
|||
850 |
|
||||
851 | # Start of ipeerconnection. |
|
|||
852 |
|
||||
853 | def url(self): |
|
|||
854 | return self._url |
|
|||
855 |
|
||||
856 | def local(self): |
|
|||
857 | return None |
|
|||
858 |
|
||||
859 | def peer(self): |
|
|||
860 | return self |
|
|||
861 |
|
||||
862 | def canpush(self): |
|
|||
863 | # TODO change once implemented. |
|
|||
864 | return False |
|
|||
865 |
|
||||
866 | def close(self): |
|
|||
867 | self.ui.note( |
|
|||
868 | _( |
|
|||
869 | b'(sent %d HTTP requests and %d bytes; ' |
|
|||
870 | b'received %d bytes in responses)\n' |
|
|||
871 | ) |
|
|||
872 | % ( |
|
|||
873 | self._opener.requestscount, |
|
|||
874 | self._opener.sentbytescount, |
|
|||
875 | self._opener.receivedbytescount, |
|
|||
876 | ) |
|
|||
877 | ) |
|
|||
878 |
|
||||
879 | # End of ipeerconnection. |
|
|||
880 |
|
||||
881 | # Start of ipeercapabilities. |
|
|||
882 |
|
||||
883 | def capable(self, name): |
|
|||
884 | # The capabilities used internally historically map to capabilities |
|
|||
885 | # advertised from the "capabilities" wire protocol command. However, |
|
|||
886 | # version 2 of that command works differently. |
|
|||
887 |
|
||||
888 | # Maps to commands that are available. |
|
|||
889 | if name in ( |
|
|||
890 | b'branchmap', |
|
|||
891 | b'getbundle', |
|
|||
892 | b'known', |
|
|||
893 | b'lookup', |
|
|||
894 | b'pushkey', |
|
|||
895 | ): |
|
|||
896 | return True |
|
|||
897 |
|
||||
898 | # Other concepts. |
|
|||
899 | if name in (b'bundle2',): |
|
|||
900 | return True |
|
|||
901 |
|
||||
902 | # Alias command-* to presence of command of that name. |
|
|||
903 | if name.startswith(b'command-'): |
|
|||
904 | return name[len(b'command-') :] in self.apidescriptor[b'commands'] |
|
|||
905 |
|
||||
906 | return False |
|
|||
907 |
|
||||
908 | def requirecap(self, name, purpose): |
|
|||
909 | if self.capable(name): |
|
|||
910 | return |
|
|||
911 |
|
||||
912 | raise error.CapabilityError( |
|
|||
913 | _( |
|
|||
914 | b'cannot %s; client or remote repository does not support the ' |
|
|||
915 | b'\'%s\' capability' |
|
|||
916 | ) |
|
|||
917 | % (purpose, name) |
|
|||
918 | ) |
|
|||
919 |
|
||||
920 | # End of ipeercapabilities. |
|
|||
921 |
|
||||
922 | def _call(self, name, **args): |
|
|||
923 | with self.commandexecutor() as e: |
|
|||
924 | return e.callcommand(name, args).result() |
|
|||
925 |
|
||||
926 | def commandexecutor(self): |
|
|||
927 | return httpv2executor( |
|
|||
928 | self.ui, |
|
|||
929 | self._opener, |
|
|||
930 | self._requestbuilder, |
|
|||
931 | self._apiurl, |
|
|||
932 | self.apidescriptor, |
|
|||
933 | self._redirect, |
|
|||
934 | ) |
|
|||
935 |
|
||||
936 |
|
||||
937 | # Registry of API service names to metadata about peers that handle it. |
|
|||
938 | # |
|
|||
939 | # The following keys are meaningful: |
|
|||
940 | # |
|
|||
941 | # init |
|
|||
942 | # Callable receiving (ui, repourl, servicepath, opener, requestbuilder, |
|
|||
943 | # apidescriptor) to create a peer. |
|
|||
944 | # |
|
|||
945 | # priority |
|
|||
946 | # Integer priority for the service. If we could choose from multiple |
|
|||
947 | # services, we choose the one with the highest priority. |
|
|||
948 | API_PEERS = { |
|
|||
949 | wireprototypes.HTTP_WIREPROTO_V2: { |
|
|||
950 | b'init': httpv2peer, |
|
|||
951 | b'priority': 50, |
|
|||
952 | }, |
|
|||
953 | } |
|
|||
954 |
|
||||
955 |
|
||||
956 | def performhandshake(ui, url, opener, requestbuilder): |
|
555 | def performhandshake(ui, url, opener, requestbuilder): | |
957 | # The handshake is a request to the capabilities command. |
|
556 | # The handshake is a request to the capabilities command. | |
958 |
|
557 | |||
@@ -963,28 +562,6 b' def performhandshake(ui, url, opener, re' | |||||
963 |
|
562 | |||
964 | args = {} |
|
563 | args = {} | |
965 |
|
564 | |||
966 | # The client advertises support for newer protocols by adding an |
|
|||
967 | # X-HgUpgrade-* header with a list of supported APIs and an |
|
|||
968 | # X-HgProto-* header advertising which serializing formats it supports. |
|
|||
969 | # We only support the HTTP version 2 transport and CBOR responses for |
|
|||
970 | # now. |
|
|||
971 | advertisev2 = ui.configbool(b'experimental', b'httppeer.advertise-v2') |
|
|||
972 |
|
||||
973 | if advertisev2: |
|
|||
974 | args[b'headers'] = { |
|
|||
975 | 'X-HgProto-1': 'cbor', |
|
|||
976 | } |
|
|||
977 |
|
||||
978 | args[b'headers'].update( |
|
|||
979 | encodevalueinheaders( |
|
|||
980 | b' '.join(sorted(API_PEERS)), |
|
|||
981 | b'X-HgUpgrade', |
|
|||
982 | # We don't know the header limit this early. |
|
|||
983 | # So make it small. |
|
|||
984 | 1024, |
|
|||
985 | ) |
|
|||
986 | ) |
|
|||
987 |
|
||||
988 | req, requrl, qs = makev1commandrequest( |
|
565 | req, requrl, qs = makev1commandrequest( | |
989 | ui, requestbuilder, caps, capable, url, b'capabilities', args |
|
566 | ui, requestbuilder, caps, capable, url, b'capabilities', args | |
990 | ) |
|
567 | ) | |
@@ -1004,7 +581,7 b' def performhandshake(ui, url, opener, re' | |||||
1004 | # redirect that drops the query string to "just work." |
|
581 | # redirect that drops the query string to "just work." | |
1005 | try: |
|
582 | try: | |
1006 | respurl, ct, resp = parsev1commandresponse( |
|
583 | respurl, ct, resp = parsev1commandresponse( | |
1007 |
ui, url, requrl, qs, resp, compressible=False |
|
584 | ui, url, requrl, qs, resp, compressible=False | |
1008 | ) |
|
585 | ) | |
1009 | except RedirectedRepoError as e: |
|
586 | except RedirectedRepoError as e: | |
1010 | req, requrl, qs = makev1commandrequest( |
|
587 | req, requrl, qs = makev1commandrequest( | |
@@ -1012,7 +589,7 b' def performhandshake(ui, url, opener, re' | |||||
1012 | ) |
|
589 | ) | |
1013 | resp = sendrequest(ui, opener, req) |
|
590 | resp = sendrequest(ui, opener, req) | |
1014 | respurl, ct, resp = parsev1commandresponse( |
|
591 | respurl, ct, resp = parsev1commandresponse( | |
1015 |
ui, url, requrl, qs, resp, compressible=False |
|
592 | ui, url, requrl, qs, resp, compressible=False | |
1016 | ) |
|
593 | ) | |
1017 |
|
594 | |||
1018 | try: |
|
595 | try: | |
@@ -1023,29 +600,7 b' def performhandshake(ui, url, opener, re' | |||||
1023 | if not ct.startswith(b'application/mercurial-'): |
|
600 | if not ct.startswith(b'application/mercurial-'): | |
1024 | raise error.ProgrammingError(b'unexpected content-type: %s' % ct) |
|
601 | raise error.ProgrammingError(b'unexpected content-type: %s' % ct) | |
1025 |
|
602 | |||
1026 | if advertisev2: |
|
603 | info = {b'v1capabilities': set(rawdata.split())} | |
1027 | if ct == b'application/mercurial-cbor': |
|
|||
1028 | try: |
|
|||
1029 | info = cborutil.decodeall(rawdata)[0] |
|
|||
1030 | except cborutil.CBORDecodeError: |
|
|||
1031 | raise error.Abort( |
|
|||
1032 | _(b'error decoding CBOR from remote server'), |
|
|||
1033 | hint=_( |
|
|||
1034 | b'try again and consider contacting ' |
|
|||
1035 | b'the server operator' |
|
|||
1036 | ), |
|
|||
1037 | ) |
|
|||
1038 |
|
||||
1039 | # We got a legacy response. That's fine. |
|
|||
1040 | elif ct in (b'application/mercurial-0.1', b'application/mercurial-0.2'): |
|
|||
1041 | info = {b'v1capabilities': set(rawdata.split())} |
|
|||
1042 |
|
||||
1043 | else: |
|
|||
1044 | raise error.RepoError( |
|
|||
1045 | _(b'unexpected response type from server: %s') % ct |
|
|||
1046 | ) |
|
|||
1047 | else: |
|
|||
1048 | info = {b'v1capabilities': set(rawdata.split())} |
|
|||
1049 |
|
604 | |||
1050 | return respurl, info |
|
605 | return respurl, info | |
1051 |
|
606 | |||
@@ -1073,29 +628,6 b' def makepeer(ui, path, opener=None, requ' | |||||
1073 |
|
628 | |||
1074 | respurl, info = performhandshake(ui, url, opener, requestbuilder) |
|
629 | respurl, info = performhandshake(ui, url, opener, requestbuilder) | |
1075 |
|
630 | |||
1076 | # Given the intersection of APIs that both we and the server support, |
|
|||
1077 | # sort by their advertised priority and pick the first one. |
|
|||
1078 | # |
|
|||
1079 | # TODO consider making this request-based and interface driven. For |
|
|||
1080 | # example, the caller could say "I want a peer that does X." It's quite |
|
|||
1081 | # possible that not all peers would do that. Since we know the service |
|
|||
1082 | # capabilities, we could filter out services not meeting the |
|
|||
1083 | # requirements. Possibly by consulting the interfaces defined by the |
|
|||
1084 | # peer type. |
|
|||
1085 | apipeerchoices = set(info.get(b'apis', {}).keys()) & set(API_PEERS.keys()) |
|
|||
1086 |
|
||||
1087 | preferredchoices = sorted( |
|
|||
1088 | apipeerchoices, key=lambda x: API_PEERS[x][b'priority'], reverse=True |
|
|||
1089 | ) |
|
|||
1090 |
|
||||
1091 | for service in preferredchoices: |
|
|||
1092 | apipath = b'%s/%s' % (info[b'apibase'].rstrip(b'/'), service) |
|
|||
1093 |
|
||||
1094 | return API_PEERS[service][b'init']( |
|
|||
1095 | ui, respurl, apipath, opener, requestbuilder, info[b'apis'][service] |
|
|||
1096 | ) |
|
|||
1097 |
|
||||
1098 | # Failed to construct an API peer. Fall back to legacy. |
|
|||
1099 | return httppeer( |
|
631 | return httppeer( | |
1100 | ui, path, respurl, opener, requestbuilder, info[b'v1capabilities'] |
|
632 | ui, path, respurl, opener, requestbuilder, info[b'v1capabilities'] | |
1101 | ) |
|
633 | ) |
@@ -16,7 +16,6 b' from . import (' | |||||
16 | error, |
|
16 | error, | |
17 | pycompat, |
|
17 | pycompat, | |
18 | util, |
|
18 | util, | |
19 | wireprotoserver, |
|
|||
20 | wireprototypes, |
|
19 | wireprototypes, | |
21 | wireprotov1peer, |
|
20 | wireprotov1peer, | |
22 | wireprotov1server, |
|
21 | wireprotov1server, | |
@@ -288,10 +287,6 b' def _performhandshake(ui, stdin, stdout,' | |||||
288 | # Generate a random token to help identify responses to version 2 |
|
287 | # Generate a random token to help identify responses to version 2 | |
289 | # upgrade request. |
|
288 | # upgrade request. | |
290 | token = pycompat.sysbytes(str(uuid.uuid4())) |
|
289 | token = pycompat.sysbytes(str(uuid.uuid4())) | |
291 | upgradecaps = [ |
|
|||
292 | (b'proto', wireprotoserver.SSHV2), |
|
|||
293 | ] |
|
|||
294 | upgradecaps = util.urlreq.urlencode(upgradecaps) |
|
|||
295 |
|
290 | |||
296 | try: |
|
291 | try: | |
297 | pairsarg = b'%s-%s' % (b'0' * 40, b'0' * 40) |
|
292 | pairsarg = b'%s-%s' % (b'0' * 40, b'0' * 40) | |
@@ -302,11 +297,6 b' def _performhandshake(ui, stdin, stdout,' | |||||
302 | pairsarg, |
|
297 | pairsarg, | |
303 | ] |
|
298 | ] | |
304 |
|
299 | |||
305 | # Request upgrade to version 2 if configured. |
|
|||
306 | if ui.configbool(b'experimental', b'sshpeer.advertise-v2'): |
|
|||
307 | ui.debug(b'sending upgrade request: %s %s\n' % (token, upgradecaps)) |
|
|||
308 | handshake.insert(0, b'upgrade %s %s\n' % (token, upgradecaps)) |
|
|||
309 |
|
||||
310 | if requestlog: |
|
300 | if requestlog: | |
311 | ui.debug(b'devel-peer-request: hello+between\n') |
|
301 | ui.debug(b'devel-peer-request: hello+between\n') | |
312 | ui.debug(b'devel-peer-request: pairs: %d bytes\n' % len(pairsarg)) |
|
302 | ui.debug(b'devel-peer-request: pairs: %d bytes\n' % len(pairsarg)) | |
@@ -365,24 +355,6 b' def _performhandshake(ui, stdin, stdout,' | |||||
365 | if l.startswith(b'capabilities:'): |
|
355 | if l.startswith(b'capabilities:'): | |
366 | caps.update(l[:-1].split(b':')[1].split()) |
|
356 | caps.update(l[:-1].split(b':')[1].split()) | |
367 | break |
|
357 | break | |
368 | elif protoname == wireprotoserver.SSHV2: |
|
|||
369 | # We see a line with number of bytes to follow and then a value |
|
|||
370 | # looking like ``capabilities: *``. |
|
|||
371 | line = stdout.readline() |
|
|||
372 | try: |
|
|||
373 | valuelen = int(line) |
|
|||
374 | except ValueError: |
|
|||
375 | badresponse() |
|
|||
376 |
|
||||
377 | capsline = stdout.read(valuelen) |
|
|||
378 | if not capsline.startswith(b'capabilities: '): |
|
|||
379 | badresponse() |
|
|||
380 |
|
||||
381 | ui.debug(b'remote: %s\n' % capsline) |
|
|||
382 |
|
||||
383 | caps.update(capsline.split(b':')[1].split()) |
|
|||
384 | # Trailing newline. |
|
|||
385 | stdout.read(1) |
|
|||
386 |
|
358 | |||
387 | # Error if we couldn't find capabilities, this means: |
|
359 | # Error if we couldn't find capabilities, this means: | |
388 | # |
|
360 | # | |
@@ -601,14 +573,6 b' class sshv1peer(wireprotov1peer.wirepeer' | |||||
601 | self._readerr() |
|
573 | self._readerr() | |
602 |
|
574 | |||
603 |
|
575 | |||
604 | class sshv2peer(sshv1peer): |
|
|||
605 | """A peer that speakers version 2 of the transport protocol.""" |
|
|||
606 |
|
||||
607 | # Currently version 2 is identical to version 1 post handshake. |
|
|||
608 | # And handshake is performed before the peer is instantiated. So |
|
|||
609 | # we need no custom code. |
|
|||
610 |
|
||||
611 |
|
||||
612 | def makepeer(ui, path, proc, stdin, stdout, stderr, autoreadstderr=True): |
|
576 | def makepeer(ui, path, proc, stdin, stdout, stderr, autoreadstderr=True): | |
613 | """Make a peer instance from existing pipes. |
|
577 | """Make a peer instance from existing pipes. | |
614 |
|
578 | |||
@@ -640,17 +604,6 b' def makepeer(ui, path, proc, stdin, stdo' | |||||
640 | caps, |
|
604 | caps, | |
641 | autoreadstderr=autoreadstderr, |
|
605 | autoreadstderr=autoreadstderr, | |
642 | ) |
|
606 | ) | |
643 | elif protoname == wireprototypes.SSHV2: |
|
|||
644 | return sshv2peer( |
|
|||
645 | ui, |
|
|||
646 | path, |
|
|||
647 | proc, |
|
|||
648 | stdin, |
|
|||
649 | stdout, |
|
|||
650 | stderr, |
|
|||
651 | caps, |
|
|||
652 | autoreadstderr=autoreadstderr, |
|
|||
653 | ) |
|
|||
654 | else: |
|
607 | else: | |
655 | _cleanuppipes(ui, stdout, stdin, stderr, warn=None) |
|
608 | _cleanuppipes(ui, stdout, stdin, stderr, warn=None) | |
656 | raise error.RepoError( |
|
609 | raise error.RepoError( |
@@ -18,11 +18,9 b' from . import (' | |||||
18 | util, |
|
18 | util, | |
19 | wireprototypes, |
|
19 | wireprototypes, | |
20 | wireprotov1server, |
|
20 | wireprotov1server, | |
21 | wireprotov2server, |
|
|||
22 | ) |
|
21 | ) | |
23 | from .interfaces import util as interfaceutil |
|
22 | from .interfaces import util as interfaceutil | |
24 | from .utils import ( |
|
23 | from .utils import ( | |
25 | cborutil, |
|
|||
26 | compression, |
|
24 | compression, | |
27 | stringutil, |
|
25 | stringutil, | |
28 | ) |
|
26 | ) | |
@@ -39,7 +37,6 b" HGTYPE2 = b'application/mercurial-0.2'" | |||||
39 | HGERRTYPE = b'application/hg-error' |
|
37 | HGERRTYPE = b'application/hg-error' | |
40 |
|
38 | |||
41 | SSHV1 = wireprototypes.SSHV1 |
|
39 | SSHV1 = wireprototypes.SSHV1 | |
42 | SSHV2 = wireprototypes.SSHV2 |
|
|||
43 |
|
40 | |||
44 |
|
41 | |||
45 | def decodevaluefromheaders(req, headerprefix): |
|
42 | def decodevaluefromheaders(req, headerprefix): | |
@@ -244,97 +241,6 b' def handlewsgirequest(rctx, req, res, ch' | |||||
244 | return True |
|
241 | return True | |
245 |
|
242 | |||
246 |
|
243 | |||
247 | def _availableapis(repo): |
|
|||
248 | apis = set() |
|
|||
249 |
|
||||
250 | # Registered APIs are made available via config options of the name of |
|
|||
251 | # the protocol. |
|
|||
252 | for k, v in API_HANDLERS.items(): |
|
|||
253 | section, option = v[b'config'] # pytype: disable=attribute-error |
|
|||
254 | if repo.ui.configbool(section, option): |
|
|||
255 | apis.add(k) |
|
|||
256 |
|
||||
257 | return apis |
|
|||
258 |
|
||||
259 |
|
||||
260 | def handlewsgiapirequest(rctx, req, res, checkperm): |
|
|||
261 | """Handle requests to /api/*.""" |
|
|||
262 | assert req.dispatchparts[0] == b'api' |
|
|||
263 |
|
||||
264 | repo = rctx.repo |
|
|||
265 |
|
||||
266 | # This whole URL space is experimental for now. But we want to |
|
|||
267 | # reserve the URL space. So, 404 all URLs if the feature isn't enabled. |
|
|||
268 | if not repo.ui.configbool(b'experimental', b'web.apiserver'): |
|
|||
269 | res.status = b'404 Not Found' |
|
|||
270 | res.headers[b'Content-Type'] = b'text/plain' |
|
|||
271 | res.setbodybytes(_(b'Experimental API server endpoint not enabled')) |
|
|||
272 | return |
|
|||
273 |
|
||||
274 | # The URL space is /api/<protocol>/*. The structure of URLs under varies |
|
|||
275 | # by <protocol>. |
|
|||
276 |
|
||||
277 | availableapis = _availableapis(repo) |
|
|||
278 |
|
||||
279 | # Requests to /api/ list available APIs. |
|
|||
280 | if req.dispatchparts == [b'api']: |
|
|||
281 | res.status = b'200 OK' |
|
|||
282 | res.headers[b'Content-Type'] = b'text/plain' |
|
|||
283 | lines = [ |
|
|||
284 | _( |
|
|||
285 | b'APIs can be accessed at /api/<name>, where <name> can be ' |
|
|||
286 | b'one of the following:\n' |
|
|||
287 | ) |
|
|||
288 | ] |
|
|||
289 | if availableapis: |
|
|||
290 | lines.extend(sorted(availableapis)) |
|
|||
291 | else: |
|
|||
292 | lines.append(_(b'(no available APIs)\n')) |
|
|||
293 | res.setbodybytes(b'\n'.join(lines)) |
|
|||
294 | return |
|
|||
295 |
|
||||
296 | proto = req.dispatchparts[1] |
|
|||
297 |
|
||||
298 | if proto not in API_HANDLERS: |
|
|||
299 | res.status = b'404 Not Found' |
|
|||
300 | res.headers[b'Content-Type'] = b'text/plain' |
|
|||
301 | res.setbodybytes( |
|
|||
302 | _(b'Unknown API: %s\nKnown APIs: %s') |
|
|||
303 | % (proto, b', '.join(sorted(availableapis))) |
|
|||
304 | ) |
|
|||
305 | return |
|
|||
306 |
|
||||
307 | if proto not in availableapis: |
|
|||
308 | res.status = b'404 Not Found' |
|
|||
309 | res.headers[b'Content-Type'] = b'text/plain' |
|
|||
310 | res.setbodybytes(_(b'API %s not enabled\n') % proto) |
|
|||
311 | return |
|
|||
312 |
|
||||
313 | API_HANDLERS[proto][b'handler']( |
|
|||
314 | rctx, req, res, checkperm, req.dispatchparts[2:] |
|
|||
315 | ) |
|
|||
316 |
|
||||
317 |
|
||||
318 | # Maps API name to metadata so custom API can be registered. |
|
|||
319 | # Keys are: |
|
|||
320 | # |
|
|||
321 | # config |
|
|||
322 | # Config option that controls whether service is enabled. |
|
|||
323 | # handler |
|
|||
324 | # Callable receiving (rctx, req, res, checkperm, urlparts) that is called |
|
|||
325 | # when a request to this API is received. |
|
|||
326 | # apidescriptor |
|
|||
327 | # Callable receiving (req, repo) that is called to obtain an API |
|
|||
328 | # descriptor for this service. The response must be serializable to CBOR. |
|
|||
329 | API_HANDLERS = { |
|
|||
330 | wireprotov2server.HTTP_WIREPROTO_V2: { |
|
|||
331 | b'config': (b'experimental', b'web.api.http-v2'), |
|
|||
332 | b'handler': wireprotov2server.handlehttpv2request, |
|
|||
333 | b'apidescriptor': wireprotov2server.httpv2apidescriptor, |
|
|||
334 | }, |
|
|||
335 | } |
|
|||
336 |
|
||||
337 |
|
||||
338 | def _httpresponsetype(ui, proto, prefer_uncompressed): |
|
244 | def _httpresponsetype(ui, proto, prefer_uncompressed): | |
339 | """Determine the appropriate response type and compression settings. |
|
245 | """Determine the appropriate response type and compression settings. | |
340 |
|
246 | |||
@@ -371,55 +277,6 b' def _httpresponsetype(ui, proto, prefer_' | |||||
371 | return HGTYPE, util.compengines[b'zlib'], opts |
|
277 | return HGTYPE, util.compengines[b'zlib'], opts | |
372 |
|
278 | |||
373 |
|
279 | |||
374 | def processcapabilitieshandshake(repo, req, res, proto): |
|
|||
375 | """Called during a ?cmd=capabilities request. |
|
|||
376 |
|
||||
377 | If the client is advertising support for a newer protocol, we send |
|
|||
378 | a CBOR response with information about available services. If no |
|
|||
379 | advertised services are available, we don't handle the request. |
|
|||
380 | """ |
|
|||
381 | # Fall back to old behavior unless the API server is enabled. |
|
|||
382 | if not repo.ui.configbool(b'experimental', b'web.apiserver'): |
|
|||
383 | return False |
|
|||
384 |
|
||||
385 | clientapis = decodevaluefromheaders(req, b'X-HgUpgrade') |
|
|||
386 | protocaps = decodevaluefromheaders(req, b'X-HgProto') |
|
|||
387 | if not clientapis or not protocaps: |
|
|||
388 | return False |
|
|||
389 |
|
||||
390 | # We currently only support CBOR responses. |
|
|||
391 | protocaps = set(protocaps.split(b' ')) |
|
|||
392 | if b'cbor' not in protocaps: |
|
|||
393 | return False |
|
|||
394 |
|
||||
395 | descriptors = {} |
|
|||
396 |
|
||||
397 | for api in sorted(set(clientapis.split()) & _availableapis(repo)): |
|
|||
398 | handler = API_HANDLERS[api] |
|
|||
399 |
|
||||
400 | descriptorfn = handler.get(b'apidescriptor') |
|
|||
401 | if not descriptorfn: |
|
|||
402 | continue |
|
|||
403 |
|
||||
404 | descriptors[api] = descriptorfn(req, repo) |
|
|||
405 |
|
||||
406 | v1caps = wireprotov1server.dispatch(repo, proto, b'capabilities') |
|
|||
407 | assert isinstance(v1caps, wireprototypes.bytesresponse) |
|
|||
408 |
|
||||
409 | m = { |
|
|||
410 | # TODO allow this to be configurable. |
|
|||
411 | b'apibase': b'api/', |
|
|||
412 | b'apis': descriptors, |
|
|||
413 | b'v1capabilities': v1caps.data, |
|
|||
414 | } |
|
|||
415 |
|
||||
416 | res.status = b'200 OK' |
|
|||
417 | res.headers[b'Content-Type'] = b'application/mercurial-cbor' |
|
|||
418 | res.setbodybytes(b''.join(cborutil.streamencode(m))) |
|
|||
419 |
|
||||
420 | return True |
|
|||
421 |
|
||||
422 |
|
||||
423 | def _callhttp(repo, req, res, proto, cmd): |
|
280 | def _callhttp(repo, req, res, proto, cmd): | |
424 | # Avoid cycle involving hg module. |
|
281 | # Avoid cycle involving hg module. | |
425 | from .hgweb import common as hgwebcommon |
|
282 | from .hgweb import common as hgwebcommon | |
@@ -461,13 +318,6 b' def _callhttp(repo, req, res, proto, cmd' | |||||
461 |
|
318 | |||
462 | proto.checkperm(wireprotov1server.commands[cmd].permission) |
|
319 | proto.checkperm(wireprotov1server.commands[cmd].permission) | |
463 |
|
320 | |||
464 | # Possibly handle a modern client wanting to switch protocols. |
|
|||
465 | if cmd == b'capabilities' and processcapabilitieshandshake( |
|
|||
466 | repo, req, res, proto |
|
|||
467 | ): |
|
|||
468 |
|
||||
469 | return |
|
|||
470 |
|
||||
471 | rsp = wireprotov1server.dispatch(repo, proto, cmd) |
|
321 | rsp = wireprotov1server.dispatch(repo, proto, cmd) | |
472 |
|
322 | |||
473 | if isinstance(rsp, bytes): |
|
323 | if isinstance(rsp, bytes): | |
@@ -596,17 +446,6 b' class sshv1protocolhandler(object):' | |||||
596 | pass |
|
446 | pass | |
597 |
|
447 | |||
598 |
|
448 | |||
599 | class sshv2protocolhandler(sshv1protocolhandler): |
|
|||
600 | """Protocol handler for version 2 of the SSH protocol.""" |
|
|||
601 |
|
||||
602 | @property |
|
|||
603 | def name(self): |
|
|||
604 | return wireprototypes.SSHV2 |
|
|||
605 |
|
||||
606 | def addcapabilities(self, repo, caps): |
|
|||
607 | return caps |
|
|||
608 |
|
||||
609 |
|
||||
610 | def _runsshserver(ui, repo, fin, fout, ev): |
|
449 | def _runsshserver(ui, repo, fin, fout, ev): | |
611 | # This function operates like a state machine of sorts. The following |
|
450 | # This function operates like a state machine of sorts. The following | |
612 | # states are defined: |
|
451 | # states are defined: | |
@@ -616,19 +455,6 b' def _runsshserver(ui, repo, fin, fout, e' | |||||
616 | # new lines. These commands are processed in this state, one command |
|
455 | # new lines. These commands are processed in this state, one command | |
617 | # after the other. |
|
456 | # after the other. | |
618 | # |
|
457 | # | |
619 | # protov2-serving |
|
|||
620 | # Server is in protocol version 2 serving mode. |
|
|||
621 | # |
|
|||
622 | # upgrade-initial |
|
|||
623 | # The server is going to process an upgrade request. |
|
|||
624 | # |
|
|||
625 | # upgrade-v2-filter-legacy-handshake |
|
|||
626 | # The protocol is being upgraded to version 2. The server is expecting |
|
|||
627 | # the legacy handshake from version 1. |
|
|||
628 | # |
|
|||
629 | # upgrade-v2-finish |
|
|||
630 | # The upgrade to version 2 of the protocol is imminent. |
|
|||
631 | # |
|
|||
632 | # shutdown |
|
458 | # shutdown | |
633 | # The server is shutting down, possibly in reaction to a client event. |
|
459 | # The server is shutting down, possibly in reaction to a client event. | |
634 | # |
|
460 | # | |
@@ -637,32 +463,9 b' def _runsshserver(ui, repo, fin, fout, e' | |||||
637 | # protov1-serving -> shutdown |
|
463 | # protov1-serving -> shutdown | |
638 | # When server receives an empty request or encounters another |
|
464 | # When server receives an empty request or encounters another | |
639 | # error. |
|
465 | # error. | |
640 | # |
|
|||
641 | # protov1-serving -> upgrade-initial |
|
|||
642 | # An upgrade request line was seen. |
|
|||
643 | # |
|
|||
644 | # upgrade-initial -> upgrade-v2-filter-legacy-handshake |
|
|||
645 | # Upgrade to version 2 in progress. Server is expecting to |
|
|||
646 | # process a legacy handshake. |
|
|||
647 | # |
|
|||
648 | # upgrade-v2-filter-legacy-handshake -> shutdown |
|
|||
649 | # Client did not fulfill upgrade handshake requirements. |
|
|||
650 | # |
|
|||
651 | # upgrade-v2-filter-legacy-handshake -> upgrade-v2-finish |
|
|||
652 | # Client fulfilled version 2 upgrade requirements. Finishing that |
|
|||
653 | # upgrade. |
|
|||
654 | # |
|
|||
655 | # upgrade-v2-finish -> protov2-serving |
|
|||
656 | # Protocol upgrade to version 2 complete. Server can now speak protocol |
|
|||
657 | # version 2. |
|
|||
658 | # |
|
|||
659 | # protov2-serving -> protov1-serving |
|
|||
660 | # Ths happens by default since protocol version 2 is the same as |
|
|||
661 | # version 1 except for the handshake. |
|
|||
662 |
|
466 | |||
663 | state = b'protov1-serving' |
|
467 | state = b'protov1-serving' | |
664 | proto = sshv1protocolhandler(ui, fin, fout) |
|
468 | proto = sshv1protocolhandler(ui, fin, fout) | |
665 | protoswitched = False |
|
|||
666 |
|
469 | |||
667 | while not ev.is_set(): |
|
470 | while not ev.is_set(): | |
668 | if state == b'protov1-serving': |
|
471 | if state == b'protov1-serving': | |
@@ -674,21 +477,6 b' def _runsshserver(ui, repo, fin, fout, e' | |||||
674 | state = b'shutdown' |
|
477 | state = b'shutdown' | |
675 | continue |
|
478 | continue | |
676 |
|
479 | |||
677 | # It looks like a protocol upgrade request. Transition state to |
|
|||
678 | # handle it. |
|
|||
679 | if request.startswith(b'upgrade '): |
|
|||
680 | if protoswitched: |
|
|||
681 | _sshv1respondooberror( |
|
|||
682 | fout, |
|
|||
683 | ui.ferr, |
|
|||
684 | b'cannot upgrade protocols multiple times', |
|
|||
685 | ) |
|
|||
686 | state = b'shutdown' |
|
|||
687 | continue |
|
|||
688 |
|
||||
689 | state = b'upgrade-initial' |
|
|||
690 | continue |
|
|||
691 |
|
||||
692 | available = wireprotov1server.commands.commandavailable( |
|
480 | available = wireprotov1server.commands.commandavailable( | |
693 | request, proto |
|
481 | request, proto | |
694 | ) |
|
482 | ) | |
@@ -724,108 +512,6 b' def _runsshserver(ui, repo, fin, fout, e' | |||||
724 | b'wire protocol command: %s' % rsp |
|
512 | b'wire protocol command: %s' % rsp | |
725 | ) |
|
513 | ) | |
726 |
|
514 | |||
727 | # For now, protocol version 2 serving just goes back to version 1. |
|
|||
728 | elif state == b'protov2-serving': |
|
|||
729 | state = b'protov1-serving' |
|
|||
730 | continue |
|
|||
731 |
|
||||
732 | elif state == b'upgrade-initial': |
|
|||
733 | # We should never transition into this state if we've switched |
|
|||
734 | # protocols. |
|
|||
735 | assert not protoswitched |
|
|||
736 | assert proto.name == wireprototypes.SSHV1 |
|
|||
737 |
|
||||
738 | # Expected: upgrade <token> <capabilities> |
|
|||
739 | # If we get something else, the request is malformed. It could be |
|
|||
740 | # from a future client that has altered the upgrade line content. |
|
|||
741 | # We treat this as an unknown command. |
|
|||
742 | try: |
|
|||
743 | token, caps = request.split(b' ')[1:] |
|
|||
744 | except ValueError: |
|
|||
745 | _sshv1respondbytes(fout, b'') |
|
|||
746 | state = b'protov1-serving' |
|
|||
747 | continue |
|
|||
748 |
|
||||
749 | # Send empty response if we don't support upgrading protocols. |
|
|||
750 | if not ui.configbool(b'experimental', b'sshserver.support-v2'): |
|
|||
751 | _sshv1respondbytes(fout, b'') |
|
|||
752 | state = b'protov1-serving' |
|
|||
753 | continue |
|
|||
754 |
|
||||
755 | try: |
|
|||
756 | caps = urlreq.parseqs(caps) |
|
|||
757 | except ValueError: |
|
|||
758 | _sshv1respondbytes(fout, b'') |
|
|||
759 | state = b'protov1-serving' |
|
|||
760 | continue |
|
|||
761 |
|
||||
762 | # We don't see an upgrade request to protocol version 2. Ignore |
|
|||
763 | # the upgrade request. |
|
|||
764 | wantedprotos = caps.get(b'proto', [b''])[0] |
|
|||
765 | if SSHV2 not in wantedprotos: |
|
|||
766 | _sshv1respondbytes(fout, b'') |
|
|||
767 | state = b'protov1-serving' |
|
|||
768 | continue |
|
|||
769 |
|
||||
770 | # It looks like we can honor this upgrade request to protocol 2. |
|
|||
771 | # Filter the rest of the handshake protocol request lines. |
|
|||
772 | state = b'upgrade-v2-filter-legacy-handshake' |
|
|||
773 | continue |
|
|||
774 |
|
||||
775 | elif state == b'upgrade-v2-filter-legacy-handshake': |
|
|||
776 | # Client should have sent legacy handshake after an ``upgrade`` |
|
|||
777 | # request. Expected lines: |
|
|||
778 | # |
|
|||
779 | # hello |
|
|||
780 | # between |
|
|||
781 | # pairs 81 |
|
|||
782 | # 0000...-0000... |
|
|||
783 |
|
||||
784 | ok = True |
|
|||
785 | for line in (b'hello', b'between', b'pairs 81'): |
|
|||
786 | request = fin.readline()[:-1] |
|
|||
787 |
|
||||
788 | if request != line: |
|
|||
789 | _sshv1respondooberror( |
|
|||
790 | fout, |
|
|||
791 | ui.ferr, |
|
|||
792 | b'malformed handshake protocol: missing %s' % line, |
|
|||
793 | ) |
|
|||
794 | ok = False |
|
|||
795 | state = b'shutdown' |
|
|||
796 | break |
|
|||
797 |
|
||||
798 | if not ok: |
|
|||
799 | continue |
|
|||
800 |
|
||||
801 | request = fin.read(81) |
|
|||
802 | if request != b'%s-%s' % (b'0' * 40, b'0' * 40): |
|
|||
803 | _sshv1respondooberror( |
|
|||
804 | fout, |
|
|||
805 | ui.ferr, |
|
|||
806 | b'malformed handshake protocol: ' |
|
|||
807 | b'missing between argument value', |
|
|||
808 | ) |
|
|||
809 | state = b'shutdown' |
|
|||
810 | continue |
|
|||
811 |
|
||||
812 | state = b'upgrade-v2-finish' |
|
|||
813 | continue |
|
|||
814 |
|
||||
815 | elif state == b'upgrade-v2-finish': |
|
|||
816 | # Send the upgrade response. |
|
|||
817 | fout.write(b'upgraded %s %s\n' % (token, SSHV2)) |
|
|||
818 | servercaps = wireprotov1server.capabilities(repo, proto) |
|
|||
819 | rsp = b'capabilities: %s' % servercaps.data |
|
|||
820 | fout.write(b'%d\n%s\n' % (len(rsp), rsp)) |
|
|||
821 | fout.flush() |
|
|||
822 |
|
||||
823 | proto = sshv2protocolhandler(ui, fin, fout) |
|
|||
824 | protoswitched = True |
|
|||
825 |
|
||||
826 | state = b'protov2-serving' |
|
|||
827 | continue |
|
|||
828 |
|
||||
829 | elif state == b'shutdown': |
|
515 | elif state == b'shutdown': | |
830 | break |
|
516 | break | |
831 |
|
517 |
@@ -21,10 +21,6 b' from .utils import compression' | |||||
21 |
|
21 | |||
22 | # Names of the SSH protocol implementations. |
|
22 | # Names of the SSH protocol implementations. | |
23 | SSHV1 = b'ssh-v1' |
|
23 | SSHV1 = b'ssh-v1' | |
24 | # These are advertised over the wire. Increment the counters at the end |
|
|||
25 | # to reflect BC breakages. |
|
|||
26 | SSHV2 = b'exp-ssh-v2-0003' |
|
|||
27 | HTTP_WIREPROTO_V2 = b'exp-http-v2-0003' |
|
|||
28 |
|
24 | |||
29 | NARROWCAP = b'exp-narrow-1' |
|
25 | NARROWCAP = b'exp-narrow-1' | |
30 | ELLIPSESCAP1 = b'exp-ellipses-1' |
|
26 | ELLIPSESCAP1 = b'exp-ellipses-1' | |
@@ -37,19 +33,10 b' TRANSPORTS = {' | |||||
37 | b'transport': b'ssh', |
|
33 | b'transport': b'ssh', | |
38 | b'version': 1, |
|
34 | b'version': 1, | |
39 | }, |
|
35 | }, | |
40 | SSHV2: { |
|
|||
41 | b'transport': b'ssh', |
|
|||
42 | # TODO mark as version 2 once all commands are implemented. |
|
|||
43 | b'version': 1, |
|
|||
44 | }, |
|
|||
45 | b'http-v1': { |
|
36 | b'http-v1': { | |
46 | b'transport': b'http', |
|
37 | b'transport': b'http', | |
47 | b'version': 1, |
|
38 | b'version': 1, | |
48 | }, |
|
39 | }, | |
49 | HTTP_WIREPROTO_V2: { |
|
|||
50 | b'transport': b'http', |
|
|||
51 | b'version': 2, |
|
|||
52 | }, |
|
|||
53 | } |
|
40 | } | |
54 |
|
41 | |||
55 |
|
42 |
@@ -147,12 +147,6 b' def wireprotocommand(name, args=None, pe' | |||||
147 | k for k, v in wireprototypes.TRANSPORTS.items() if v[b'version'] == 1 |
|
147 | k for k, v in wireprototypes.TRANSPORTS.items() if v[b'version'] == 1 | |
148 | } |
|
148 | } | |
149 |
|
149 | |||
150 | # Because SSHv2 is a mirror of SSHv1, we allow "batch" commands through to |
|
|||
151 | # SSHv2. |
|
|||
152 | # TODO undo this hack when SSH is using the unified frame protocol. |
|
|||
153 | if name == b'batch': |
|
|||
154 | transports.add(wireprototypes.SSHV2) |
|
|||
155 |
|
||||
156 | if permission not in (b'push', b'pull'): |
|
150 | if permission not in (b'push', b'pull'): | |
157 | raise error.ProgrammingError( |
|
151 | raise error.ProgrammingError( | |
158 | b'invalid wire protocol permission; ' |
|
152 | b'invalid wire protocol permission; ' |
@@ -715,14 +715,15 b' Update a bookmark right after the initia' | |||||
715 | $ cat <<EOF > ../lookuphook.py |
|
715 | $ cat <<EOF > ../lookuphook.py | |
716 | > """small extensions adding a hook after wireprotocol lookup to test race""" |
|
716 | > """small extensions adding a hook after wireprotocol lookup to test race""" | |
717 | > import functools |
|
717 | > import functools | |
718 |
> from mercurial import wireprotov1server |
|
718 | > from mercurial import wireprotov1server | |
719 | > |
|
719 | > | |
720 | > def wrappedlookup(orig, repo, *args, **kwargs): |
|
720 | > def wrappedlookup(orig, repo, *args, **kwargs): | |
721 | > ret = orig(repo, *args, **kwargs) |
|
721 | > ret = orig(repo, *args, **kwargs) | |
722 | > repo.hook(b'lookup') |
|
722 | > repo.hook(b'lookup') | |
723 | > return ret |
|
723 | > return ret | |
724 | > for table in [wireprotov1server.commands, wireprotov2server.COMMANDS]: |
|
724 | > | |
725 | > table[b'lookup'].func = functools.partial(wrappedlookup, table[b'lookup'].func) |
|
725 | > table = wireprotov1server.commands | |
|
726 | > table[b'lookup'].func = functools.partial(wrappedlookup, table[b'lookup'].func) | |||
726 | > EOF |
|
727 | > EOF | |
727 | $ cat <<EOF > ../pull-race/.hg/hgrc |
|
728 | $ cat <<EOF > ../pull-race/.hg/hgrc | |
728 | > [extensions] |
|
729 | > [extensions] |
@@ -1,13 +1,3 b'' | |||||
1 | #testcases sshv1 sshv2 |
|
|||
2 |
|
||||
3 | #if sshv2 |
|
|||
4 | $ cat >> $HGRCPATH << EOF |
|
|||
5 | > [experimental] |
|
|||
6 | > sshpeer.advertise-v2 = true |
|
|||
7 | > sshserver.support-v2 = true |
|
|||
8 | > EOF |
|
|||
9 | #endif |
|
|||
10 |
|
||||
11 | Test exchange of common information using bundle2 |
|
1 | Test exchange of common information using bundle2 | |
12 |
|
2 | |||
13 |
|
3 |
@@ -1,13 +1,3 b'' | |||||
1 | #testcases sshv1 sshv2 |
|
|||
2 |
|
||||
3 | #if sshv2 |
|
|||
4 | $ cat >> $HGRCPATH << EOF |
|
|||
5 | > [experimental] |
|
|||
6 | > sshpeer.advertise-v2 = true |
|
|||
7 | > sshserver.support-v2 = true |
|
|||
8 | > EOF |
|
|||
9 | #endif |
|
|||
10 |
|
||||
11 |
|
|
1 | $ cat > bundle2.py << EOF | |
12 | > """A small extension to test bundle2 pushback parts. |
|
2 | > """A small extension to test bundle2 pushback parts. | |
13 | > Current bundle2 implementation doesn't provide a way to generate those |
|
3 | > Current bundle2 implementation doesn't provide a way to generate those |
@@ -1,13 +1,3 b'' | |||||
1 | #testcases sshv1 sshv2 |
|
|||
2 |
|
||||
3 | #if sshv2 |
|
|||
4 | $ cat >> $HGRCPATH << EOF |
|
|||
5 | > [experimental] |
|
|||
6 | > sshpeer.advertise-v2 = true |
|
|||
7 | > sshserver.support-v2 = true |
|
|||
8 | > EOF |
|
|||
9 | #endif |
|
|||
10 |
|
||||
11 | Create an extension to test bundle2 remote-changegroup parts |
|
1 | Create an extension to test bundle2 remote-changegroup parts | |
12 |
|
2 | |||
13 | $ cat > bundle2.py << EOF |
|
3 | $ cat > bundle2.py << EOF |
@@ -39,7 +39,6 b' from mercurial import (' | |||||
39 | wireprotoserver, |
|
39 | wireprotoserver, | |
40 | wireprototypes, |
|
40 | wireprototypes, | |
41 | wireprotov1peer, |
|
41 | wireprotov1peer, | |
42 | wireprotov2server, |
|
|||
43 | ) |
|
42 | ) | |
44 |
|
43 | |||
45 | testdir = os.path.dirname(__file__) |
|
44 | testdir = os.path.dirname(__file__) | |
@@ -129,9 +128,6 b' def main():' | |||||
129 | ziverify.verifyClass(repository.ipeerbase, httppeer.httppeer) |
|
128 | ziverify.verifyClass(repository.ipeerbase, httppeer.httppeer) | |
130 | checkzobject(httppeer.httppeer(None, None, None, dummyopener(), None, None)) |
|
129 | checkzobject(httppeer.httppeer(None, None, None, dummyopener(), None, None)) | |
131 |
|
130 | |||
132 | ziverify.verifyClass(repository.ipeerv2, httppeer.httpv2peer) |
|
|||
133 | checkzobject(httppeer.httpv2peer(None, b'', b'', None, None, None)) |
|
|||
134 |
|
||||
135 | ziverify.verifyClass(repository.ipeerbase, localrepo.localpeer) |
|
131 | ziverify.verifyClass(repository.ipeerbase, localrepo.localpeer) | |
136 | checkzobject(localrepo.localpeer(dummyrepo())) |
|
132 | checkzobject(localrepo.localpeer(dummyrepo())) | |
137 |
|
133 | |||
@@ -158,19 +154,6 b' def main():' | |||||
158 | ) |
|
154 | ) | |
159 | ) |
|
155 | ) | |
160 |
|
156 | |||
161 | ziverify.verifyClass(repository.ipeerbase, sshpeer.sshv2peer) |
|
|||
162 | checkzobject( |
|
|||
163 | sshpeer.sshv2peer( |
|
|||
164 | ui, |
|
|||
165 | b'ssh://localhost/foo', |
|
|||
166 | b'', |
|
|||
167 | dummypipe(), |
|
|||
168 | dummypipe(), |
|
|||
169 | None, |
|
|||
170 | None, |
|
|||
171 | ) |
|
|||
172 | ) |
|
|||
173 |
|
||||
174 | ziverify.verifyClass(repository.ipeerbase, bundlerepo.bundlepeer) |
|
157 | ziverify.verifyClass(repository.ipeerbase, bundlerepo.bundlepeer) | |
175 | checkzobject(bundlerepo.bundlepeer(dummyrepo())) |
|
158 | checkzobject(bundlerepo.bundlepeer(dummyrepo())) | |
176 |
|
159 | |||
@@ -193,26 +176,15 b' def main():' | |||||
193 | wireprototypes.baseprotocolhandler, wireprotoserver.sshv1protocolhandler |
|
176 | wireprototypes.baseprotocolhandler, wireprotoserver.sshv1protocolhandler | |
194 | ) |
|
177 | ) | |
195 | ziverify.verifyClass( |
|
178 | ziverify.verifyClass( | |
196 | wireprototypes.baseprotocolhandler, wireprotoserver.sshv2protocolhandler |
|
|||
197 | ) |
|
|||
198 | ziverify.verifyClass( |
|
|||
199 | wireprototypes.baseprotocolhandler, |
|
179 | wireprototypes.baseprotocolhandler, | |
200 | wireprotoserver.httpv1protocolhandler, |
|
180 | wireprotoserver.httpv1protocolhandler, | |
201 | ) |
|
181 | ) | |
202 | ziverify.verifyClass( |
|
|||
203 | wireprototypes.baseprotocolhandler, |
|
|||
204 | wireprotov2server.httpv2protocolhandler, |
|
|||
205 | ) |
|
|||
206 |
|
182 | |||
207 | sshv1 = wireprotoserver.sshv1protocolhandler(None, None, None) |
|
183 | sshv1 = wireprotoserver.sshv1protocolhandler(None, None, None) | |
208 | checkzobject(sshv1) |
|
184 | checkzobject(sshv1) | |
209 | sshv2 = wireprotoserver.sshv2protocolhandler(None, None, None) |
|
|||
210 | checkzobject(sshv2) |
|
|||
211 |
|
185 | |||
212 | httpv1 = wireprotoserver.httpv1protocolhandler(None, None, None) |
|
186 | httpv1 = wireprotoserver.httpv1protocolhandler(None, None, None) | |
213 | checkzobject(httpv1) |
|
187 | checkzobject(httpv1) | |
214 | httpv2 = wireprotov2server.httpv2protocolhandler(None, None) |
|
|||
215 | checkzobject(httpv2) |
|
|||
216 |
|
188 | |||
217 | ziverify.verifyClass(repository.ifilestorage, filelog.filelog) |
|
189 | ziverify.verifyClass(repository.ifilestorage, filelog.filelog) | |
218 | ziverify.verifyClass(repository.imanifestdict, manifest.manifestdict) |
|
190 | ziverify.verifyClass(repository.imanifestdict, manifest.manifestdict) |
@@ -1,13 +1,3 b'' | |||||
1 | #testcases sshv1 sshv2 |
|
|||
2 |
|
||||
3 | #if sshv2 |
|
|||
4 | $ cat >> $HGRCPATH << EOF |
|
|||
5 | > [experimental] |
|
|||
6 | > sshpeer.advertise-v2 = true |
|
|||
7 | > sshserver.support-v2 = true |
|
|||
8 | > EOF |
|
|||
9 | #endif |
|
|||
10 |
|
||||
11 | Prepare repo a: |
|
1 | Prepare repo a: | |
12 |
|
2 | |||
13 | $ hg init a |
|
3 | $ hg init a | |
@@ -1206,14 +1196,12 b' SEC: check for unsafe ssh url' | |||||
1206 | #if windows |
|
1196 | #if windows | |
1207 | $ hg clone "ssh://%26touch%20owned%20/" --debug |
|
1197 | $ hg clone "ssh://%26touch%20owned%20/" --debug | |
1208 | running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio" |
|
1198 | running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio" | |
1209 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
|||
1210 | sending hello command |
|
1199 | sending hello command | |
1211 | sending between command |
|
1200 | sending between command | |
1212 | abort: no suitable response from remote hg |
|
1201 | abort: no suitable response from remote hg | |
1213 | [255] |
|
1202 | [255] | |
1214 | $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug |
|
1203 | $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug | |
1215 | running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio" |
|
1204 | running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio" | |
1216 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
|||
1217 | sending hello command |
|
1205 | sending hello command | |
1218 | sending between command |
|
1206 | sending between command | |
1219 | abort: no suitable response from remote hg |
|
1207 | abort: no suitable response from remote hg | |
@@ -1221,14 +1209,12 b' SEC: check for unsafe ssh url' | |||||
1221 | #else |
|
1209 | #else | |
1222 | $ hg clone "ssh://%3btouch%20owned%20/" --debug |
|
1210 | $ hg clone "ssh://%3btouch%20owned%20/" --debug | |
1223 | running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio' |
|
1211 | running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio' | |
1224 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
|||
1225 | sending hello command |
|
1212 | sending hello command | |
1226 | sending between command |
|
1213 | sending between command | |
1227 | abort: no suitable response from remote hg |
|
1214 | abort: no suitable response from remote hg | |
1228 | [255] |
|
1215 | [255] | |
1229 | $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug |
|
1216 | $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug | |
1230 | running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio' |
|
1217 | running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio' | |
1231 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
|||
1232 | sending hello command |
|
1218 | sending hello command | |
1233 | sending between command |
|
1219 | sending between command | |
1234 | abort: no suitable response from remote hg |
|
1220 | abort: no suitable response from remote hg | |
@@ -1237,7 +1223,6 b' SEC: check for unsafe ssh url' | |||||
1237 |
|
1223 | |||
1238 | $ hg clone "ssh://v-alid.example.com/" --debug |
|
1224 | $ hg clone "ssh://v-alid.example.com/" --debug | |
1239 | running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re) |
|
1225 | running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re) | |
1240 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
|||
1241 | sending hello command |
|
1226 | sending hello command | |
1242 | sending between command |
|
1227 | sending between command | |
1243 | abort: no suitable response from remote hg |
|
1228 | abort: no suitable response from remote hg |
@@ -252,121 +252,6 b' Same thing, but with "httprequest" comma' | |||||
252 | s> bookmarks\t\n |
|
252 | s> bookmarks\t\n | |
253 | s> namespaces\t\n |
|
253 | s> namespaces\t\n | |
254 | s> phases\t |
|
254 | s> phases\t | |
255 |
|
||||
256 | Client with HTTPv2 enabled advertises that and gets old capabilities response from old server |
|
|||
257 |
|
||||
258 | $ hg --config experimental.httppeer.advertise-v2=true --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF |
|
|||
259 | > command heads |
|
|||
260 | > EOF |
|
|||
261 | s> setsockopt(6, 1, 1) -> None (?) |
|
|||
262 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
|||
263 | s> Accept-Encoding: identity\r\n |
|
|||
264 | s> vary: X-HgProto-1,X-HgUpgrade-1\r\n |
|
|||
265 | s> x-hgproto-1: cbor\r\n |
|
|||
266 | s> x-hgupgrade-1: exp-http-v2-0003\r\n |
|
|||
267 | s> accept: application/mercurial-0.1\r\n |
|
|||
268 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
|||
269 | s> user-agent: Mercurial debugwireproto\r\n |
|
|||
270 | s> \r\n |
|
|||
271 | s> makefile('rb', None) |
|
|||
272 | s> HTTP/1.1 200 Script output follows\r\n |
|
|||
273 | s> Server: testing stub value\r\n |
|
|||
274 | s> Date: $HTTP_DATE$\r\n |
|
|||
275 | s> Content-Type: application/mercurial-0.1\r\n |
|
|||
276 | s> Content-Length: *\r\n (glob) |
|
|||
277 | s> \r\n |
|
|||
278 | s> batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
279 | sending heads command |
|
|||
280 | s> setsockopt(6, 1, 1) -> None (?) |
|
|||
281 | s> GET /?cmd=heads HTTP/1.1\r\n |
|
|||
282 | s> Accept-Encoding: identity\r\n |
|
|||
283 | s> vary: X-HgProto-1\r\n |
|
|||
284 | s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n |
|
|||
285 | s> accept: application/mercurial-0.1\r\n |
|
|||
286 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
|||
287 | s> user-agent: Mercurial debugwireproto\r\n |
|
|||
288 | s> \r\n |
|
|||
289 | s> makefile('rb', None) |
|
|||
290 | s> HTTP/1.1 200 Script output follows\r\n |
|
|||
291 | s> Server: testing stub value\r\n |
|
|||
292 | s> Date: $HTTP_DATE$\r\n |
|
|||
293 | s> Content-Type: application/mercurial-0.1\r\n |
|
|||
294 | s> Content-Length: 41\r\n |
|
|||
295 | s> \r\n |
|
|||
296 | s> 0000000000000000000000000000000000000000\n |
|
|||
297 | response: [ |
|
|||
298 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
|
|||
299 | ] |
|
|||
300 | (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
|||
301 |
|
||||
302 | $ killdaemons.py |
|
|||
303 | $ enablehttpv2 empty |
|
|||
304 | $ hg --config server.compressionengines=zlib -R empty serve -p $HGPORT -d --pid-file hg.pid |
|
|||
305 | $ cat hg.pid > $DAEMON_PIDS |
|
|||
306 |
|
||||
307 | Client with HTTPv2 enabled automatically upgrades if the server supports it |
|
|||
308 |
|
||||
309 | $ hg --config experimental.httppeer.advertise-v2=true --config experimental.httppeer.v2-encoder-order=identity --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF |
|
|||
310 | > command heads |
|
|||
311 | > EOF |
|
|||
312 | s> setsockopt(6, 1, 1) -> None (?) |
|
|||
313 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
|||
314 | s> Accept-Encoding: identity\r\n |
|
|||
315 | s> vary: X-HgProto-1,X-HgUpgrade-1\r\n |
|
|||
316 | s> x-hgproto-1: cbor\r\n |
|
|||
317 | s> x-hgupgrade-1: exp-http-v2-0003\r\n |
|
|||
318 | s> accept: application/mercurial-0.1\r\n |
|
|||
319 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
|||
320 | s> user-agent: Mercurial debugwireproto\r\n |
|
|||
321 | s> \r\n |
|
|||
322 | s> makefile('rb', None) |
|
|||
323 | s> HTTP/1.1 200 OK\r\n |
|
|||
324 | s> Server: testing stub value\r\n |
|
|||
325 | s> Date: $HTTP_DATE$\r\n |
|
|||
326 | s> Content-Type: application/mercurial-cbor\r\n |
|
|||
327 | s> Content-Length: *\r\n (glob) |
|
|||
328 | s> \r\n |
|
|||
329 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0003\xa4Hcommands\xacIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa2Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84IbookmarksGparentsEphaseHrevisionIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x83HlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDpath\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullIfilesdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84NfirstchangesetHlinknodeGparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDdictIrevisions\xa2Hrequired\xf5DtypeDlistKpermissions\x81DpullTrecommendedbatchsize\x19\xc3PEheads\xa2Dargs\xa1Jpubliconly\xa3Gdefault\xf4Hrequired\xf4DtypeDboolKpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\xa3Gdefault\x80Hrequired\xf4DtypeDlistKpermissions\x81DpullHlistkeys\xa2Dargs\xa1Inamespace\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullFlookup\xa2Dargs\xa1Ckey\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullLmanifestdata\xa3Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDtree\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullTrecommendedbatchsize\x1a\x00\x01\x86\xa0Gpushkey\xa2Dargs\xa4Ckey\xa2Hrequired\xf5DtypeEbytesInamespace\xa2Hrequired\xf5DtypeEbytesCnew\xa2Hrequired\xf5DtypeEbytesCold\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpushPrawstorefiledata\xa2Dargs\xa2Efiles\xa2Hrequired\xf5DtypeDlistJpathfilter\xa3Gdefault\xf6Hrequired\xf4DtypeDlistKpermissions\x81DpullQframingmediatypes\x81X&application/mercurial-exp-framing-0006Rpathfilterprefixes\xd9\x01\x02\x82Epath:Lrootfilesin:Nrawrepoformats\x83LgeneraldeltaHrevlogv1LsparserevlogNv1capabilitiesY\x01\xe4batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
330 | sending heads command |
|
|||
331 | s> setsockopt(6, 1, 1) -> None (?) |
|
|||
332 | s> POST /api/exp-http-v2-0003/ro/heads HTTP/1.1\r\n |
|
|||
333 | s> Accept-Encoding: identity\r\n |
|
|||
334 | s> accept: application/mercurial-exp-framing-0006\r\n |
|
|||
335 | s> content-type: application/mercurial-exp-framing-0006\r\n |
|
|||
336 | s> content-length: 56\r\n |
|
|||
337 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
|||
338 | s> user-agent: Mercurial debugwireproto\r\n |
|
|||
339 | s> \r\n |
|
|||
340 | s> \x1c\x00\x00\x01\x00\x01\x01\x82\xa1Pcontentencodings\x81Hidentity\x0c\x00\x00\x01\x00\x01\x00\x11\xa1DnameEheads |
|
|||
341 | s> makefile('rb', None) |
|
|||
342 | s> HTTP/1.1 200 OK\r\n |
|
|||
343 | s> Server: testing stub value\r\n |
|
|||
344 | s> Date: $HTTP_DATE$\r\n |
|
|||
345 | s> Content-Type: application/mercurial-exp-framing-0006\r\n |
|
|||
346 | s> Transfer-Encoding: chunked\r\n |
|
|||
347 | s> \r\n |
|
|||
348 | s> 11\r\n |
|
|||
349 | s> \t\x00\x00\x01\x00\x02\x01\x92 |
|
|||
350 | s> Hidentity |
|
|||
351 | s> \r\n |
|
|||
352 | s> 13\r\n |
|
|||
353 | s> \x0b\x00\x00\x01\x00\x02\x041 |
|
|||
354 | s> \xa1FstatusBok |
|
|||
355 | s> \r\n |
|
|||
356 | s> 1e\r\n |
|
|||
357 | s> \x16\x00\x00\x01\x00\x02\x041 |
|
|||
358 | s> \x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
359 | s> \r\n |
|
|||
360 | s> 8\r\n |
|
|||
361 | s> \x00\x00\x00\x01\x00\x02\x002 |
|
|||
362 | s> \r\n |
|
|||
363 | s> 0\r\n |
|
|||
364 | s> \r\n |
|
|||
365 | response: [ |
|
|||
366 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
|
|||
367 | ] |
|
|||
368 | (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
|||
369 |
|
||||
370 | $ killdaemons.py |
|
255 | $ killdaemons.py | |
371 |
|
256 | |||
372 | HTTP client follows HTTP redirect on handshake to new repo |
|
257 | HTTP client follows HTTP redirect on handshake to new repo |
@@ -1,13 +1,3 b'' | |||||
1 | #testcases sshv1 sshv2 |
|
|||
2 |
|
||||
3 | #if sshv2 |
|
|||
4 | $ cat >> $HGRCPATH << EOF |
|
|||
5 | > [experimental] |
|
|||
6 | > sshpeer.advertise-v2 = true |
|
|||
7 | > sshserver.support-v2 = true |
|
|||
8 | > EOF |
|
|||
9 | #endif |
|
|||
10 |
|
||||
11 | This file contains testcases that tend to be related to the wire protocol part |
|
1 | This file contains testcases that tend to be related to the wire protocol part | |
12 | of largefiles. |
|
2 | of largefiles. | |
13 |
|
3 |
@@ -1,15 +1,5 b'' | |||||
1 | #require serve |
|
1 | #require serve | |
2 |
|
2 | |||
3 | #testcases sshv1 sshv2 |
|
|||
4 |
|
||||
5 | #if sshv2 |
|
|||
6 | $ cat >> $HGRCPATH << EOF |
|
|||
7 | > [experimental] |
|
|||
8 | > sshpeer.advertise-v2 = true |
|
|||
9 | > sshserver.support-v2 = true |
|
|||
10 | > EOF |
|
|||
11 | #endif |
|
|||
12 |
|
||||
13 | $ hg init test |
|
3 | $ hg init test | |
14 | $ cd test |
|
4 | $ cd test | |
15 |
|
5 |
@@ -1,16 +1,6 b'' | |||||
1 | This test is a duplicate of 'test-http.t' feel free to factor out |
|
1 | This test is a duplicate of 'test-http.t' feel free to factor out | |
2 | parts that are not bundle1/bundle2 specific. |
|
2 | parts that are not bundle1/bundle2 specific. | |
3 |
|
3 | |||
4 | #testcases sshv1 sshv2 |
|
|||
5 |
|
||||
6 | #if sshv2 |
|
|||
7 | $ cat >> $HGRCPATH << EOF |
|
|||
8 | > [experimental] |
|
|||
9 | > sshpeer.advertise-v2 = true |
|
|||
10 | > sshserver.support-v2 = true |
|
|||
11 | > EOF |
|
|||
12 | #endif |
|
|||
13 |
|
||||
14 | $ cat << EOF >> $HGRCPATH |
|
4 | $ cat << EOF >> $HGRCPATH | |
15 | > [devel] |
|
5 | > [devel] | |
16 | > # This test is dedicated to interaction through old bundle |
|
6 | > # This test is dedicated to interaction through old bundle | |
@@ -483,15 +473,13 b' debug output' | |||||
483 | $ hg pull --debug ssh://user@dummy/remote |
|
473 | $ hg pull --debug ssh://user@dummy/remote | |
484 | pulling from ssh://user@dummy/remote |
|
474 | pulling from ssh://user@dummy/remote | |
485 | running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re) |
|
475 | running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re) | |
486 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
|||
487 | sending hello command |
|
476 | sending hello command | |
488 | sending between command |
|
477 | sending between command | |
489 |
remote: 444 ( |
|
478 | remote: 444 (no-rust !) | |
490 |
remote: 463 ( |
|
479 | remote: 463 (rust !) | |
491 | protocol upgraded to exp-ssh-v2-0003 (sshv2 !) |
|
|||
492 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (no-rust !) |
|
480 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (no-rust !) | |
493 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,persistent-nodemap,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (rust !) |
|
481 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,persistent-nodemap,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (rust !) | |
494 |
remote: 1 |
|
482 | remote: 1 | |
495 | sending protocaps command |
|
483 | sending protocaps command | |
496 | preparing listkeys for "bookmarks" |
|
484 | preparing listkeys for "bookmarks" | |
497 | sending listkeys command |
|
485 | sending listkeys command |
@@ -1,15 +1,5 b'' | |||||
1 | This test tries to exercise the ssh functionality with a dummy script |
|
1 | This test tries to exercise the ssh functionality with a dummy script | |
2 |
|
2 | |||
3 | #testcases sshv1 sshv2 |
|
|||
4 |
|
||||
5 | #if sshv2 |
|
|||
6 | $ cat >> $HGRCPATH << EOF |
|
|||
7 | > [experimental] |
|
|||
8 | > sshpeer.advertise-v2 = true |
|
|||
9 | > sshserver.support-v2 = true |
|
|||
10 | > EOF |
|
|||
11 | #endif |
|
|||
12 |
|
||||
13 | creating 'remote' repo |
|
3 | creating 'remote' repo | |
14 |
|
4 | |||
15 | $ hg init remote |
|
5 | $ hg init remote |
This diff has been collapsed as it changes many lines, (860 lines changed) Show them Hide them | |||||
@@ -5,13 +5,6 b' persistent-nodemap is not enabled by def' | |||||
5 | > use-persistent-nodemap = no |
|
5 | > use-persistent-nodemap = no | |
6 | > EOF |
|
6 | > EOF | |
7 |
|
7 | |||
8 | $ cat > hgrc-sshv2 << EOF |
|
|||
9 | > %include $HGRCPATH |
|
|||
10 | > [experimental] |
|
|||
11 | > sshpeer.advertise-v2 = true |
|
|||
12 | > sshserver.support-v2 = true |
|
|||
13 | > EOF |
|
|||
14 |
|
||||
15 | $ debugwireproto() { |
|
8 | $ debugwireproto() { | |
16 | > commands=`cat -` |
|
9 | > commands=`cat -` | |
17 | > echo 'testing ssh1' |
|
10 | > echo 'testing ssh1' | |
@@ -20,12 +13,6 b' persistent-nodemap is not enabled by def' | |||||
20 | > if [ -n "$1" ]; then |
|
13 | > if [ -n "$1" ]; then | |
21 | > hg --config extensions.strip= strip --no-backup -r "all() - ::${tip}" |
|
14 | > hg --config extensions.strip= strip --no-backup -r "all() - ::${tip}" | |
22 | > fi |
|
15 | > fi | |
23 | > echo "" |
|
|||
24 | > echo 'testing ssh2' |
|
|||
25 | > echo "${commands}" | HGRCPATH=$TESTTMP/hgrc-sshv2 hg --verbose debugwireproto --localssh --noreadstderr |
|
|||
26 | > if [ -n "$1" ]; then |
|
|||
27 | > hg --config extensions.strip= strip --no-backup -r "all() - ::${tip}" |
|
|||
28 | > fi |
|
|||
29 | > } |
|
16 | > } | |
30 |
|
17 | |||
31 | Generate some bundle files |
|
18 | Generate some bundle files | |
@@ -103,56 +90,6 b' Test pushing bundle1 payload to a server' | |||||
103 | e> read(-1) -> 115: |
|
90 | e> read(-1) -> 115: | |
104 | e> abort: incompatible Mercurial client; bundle2 required\n |
|
91 | e> abort: incompatible Mercurial client; bundle2 required\n | |
105 | e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n |
|
92 | e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n | |
106 |
|
||||
107 | testing ssh2 |
|
|||
108 | creating ssh peer from handshake results |
|
|||
109 | i> write(171) -> 171: |
|
|||
110 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
111 | i> hello\n |
|
|||
112 | i> between\n |
|
|||
113 | i> pairs 81\n |
|
|||
114 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
115 | i> flush() -> None |
|
|||
116 | o> readline() -> 62: |
|
|||
117 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
118 | o> readline() -> 4: |
|
|||
119 | o> 443\n |
|
|||
120 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
121 | o> read(1) -> 1: |
|
|||
122 | o> \n |
|
|||
123 | sending unbundle command |
|
|||
124 | i> write(9) -> 9: |
|
|||
125 | i> unbundle\n |
|
|||
126 | i> write(9) -> 9: |
|
|||
127 | i> heads 10\n |
|
|||
128 | i> write(10) -> 10: 666f726365 |
|
|||
129 | i> flush() -> None |
|
|||
130 | o> readline() -> 2: |
|
|||
131 | o> 0\n |
|
|||
132 | i> write(4) -> 4: |
|
|||
133 | i> 426\n |
|
|||
134 | i> write(426) -> 426: |
|
|||
135 | 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 |
|
|||
136 | i> test\n |
|
|||
137 | i> 0 0\n |
|
|||
138 | i> foo\n |
|
|||
139 | i> \n |
|
|||
140 | 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 |
|
|||
141 | 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 |
|
|||
142 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
143 | i> write(2) -> 2: |
|
|||
144 | i> 0\n |
|
|||
145 | i> flush() -> None |
|
|||
146 | o> readline() -> 2: |
|
|||
147 | o> 0\n |
|
|||
148 | o> readline() -> 2: |
|
|||
149 | o> 1\n |
|
|||
150 | o> read(1) -> 1: 0 |
|
|||
151 | result: 0 |
|
|||
152 | remote output: |
|
|||
153 | e> read(-1) -> 115: |
|
|||
154 | e> abort: incompatible Mercurial client; bundle2 required\n |
|
|||
155 | e> (see https://www.mercurial-scm.org/wiki/IncompatibleClient)\n |
|
|||
156 |
|
93 | |||
157 | $ cd .. |
|
94 | $ cd .. | |
158 |
|
95 | |||
@@ -287,61 +224,6 b' ui.write() in hook is redirected to stde' | |||||
287 | e> transaction abort!\n |
|
224 | e> transaction abort!\n | |
288 | e> rollback completed\n |
|
225 | e> rollback completed\n | |
289 | e> abort: pretxnchangegroup.fail hook failed\n |
|
226 | e> abort: pretxnchangegroup.fail hook failed\n | |
290 |
|
||||
291 | testing ssh2 |
|
|||
292 | creating ssh peer from handshake results |
|
|||
293 | i> write(171) -> 171: |
|
|||
294 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
295 | i> hello\n |
|
|||
296 | i> between\n |
|
|||
297 | i> pairs 81\n |
|
|||
298 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
299 | i> flush() -> None |
|
|||
300 | o> readline() -> 62: |
|
|||
301 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
302 | o> readline() -> 4: |
|
|||
303 | o> 443\n |
|
|||
304 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
305 | o> read(1) -> 1: |
|
|||
306 | o> \n |
|
|||
307 | sending unbundle command |
|
|||
308 | i> write(9) -> 9: |
|
|||
309 | i> unbundle\n |
|
|||
310 | i> write(9) -> 9: |
|
|||
311 | i> heads 10\n |
|
|||
312 | i> write(10) -> 10: 666f726365 |
|
|||
313 | i> flush() -> None |
|
|||
314 | o> readline() -> 2: |
|
|||
315 | o> 0\n |
|
|||
316 | i> write(4) -> 4: |
|
|||
317 | i> 426\n |
|
|||
318 | i> write(426) -> 426: |
|
|||
319 | 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 |
|
|||
320 | i> test\n |
|
|||
321 | i> 0 0\n |
|
|||
322 | i> foo\n |
|
|||
323 | i> \n |
|
|||
324 | 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 |
|
|||
325 | 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 |
|
|||
326 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
327 | i> write(2) -> 2: |
|
|||
328 | i> 0\n |
|
|||
329 | i> flush() -> None |
|
|||
330 | o> readline() -> 2: |
|
|||
331 | o> 0\n |
|
|||
332 | o> readline() -> 2: |
|
|||
333 | o> 1\n |
|
|||
334 | o> read(1) -> 1: 0 |
|
|||
335 | result: 0 |
|
|||
336 | remote output: |
|
|||
337 | e> read(-1) -> 151: |
|
|||
338 | e> adding changesets\n |
|
|||
339 | e> adding manifests\n |
|
|||
340 | e> adding file changes\n |
|
|||
341 | e> ui.write 1 line\n |
|
|||
342 | e> transaction abort!\n |
|
|||
343 | e> rollback completed\n |
|
|||
344 | e> abort: pretxnchangegroup.fail hook failed\n |
|
|||
345 |
|
227 | |||
346 | And a variation that writes multiple lines using ui.write |
|
228 | And a variation that writes multiple lines using ui.write | |
347 |
|
229 | |||
@@ -412,62 +294,6 b' And a variation that writes multiple lin' | |||||
412 | e> transaction abort!\n |
|
294 | e> transaction abort!\n | |
413 | e> rollback completed\n |
|
295 | e> rollback completed\n | |
414 | e> abort: pretxnchangegroup.fail hook failed\n |
|
296 | e> abort: pretxnchangegroup.fail hook failed\n | |
415 |
|
||||
416 | testing ssh2 |
|
|||
417 | creating ssh peer from handshake results |
|
|||
418 | i> write(171) -> 171: |
|
|||
419 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
420 | i> hello\n |
|
|||
421 | i> between\n |
|
|||
422 | i> pairs 81\n |
|
|||
423 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
424 | i> flush() -> None |
|
|||
425 | o> readline() -> 62: |
|
|||
426 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
427 | o> readline() -> 4: |
|
|||
428 | o> 443\n |
|
|||
429 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
430 | o> read(1) -> 1: |
|
|||
431 | o> \n |
|
|||
432 | sending unbundle command |
|
|||
433 | i> write(9) -> 9: |
|
|||
434 | i> unbundle\n |
|
|||
435 | i> write(9) -> 9: |
|
|||
436 | i> heads 10\n |
|
|||
437 | i> write(10) -> 10: 666f726365 |
|
|||
438 | i> flush() -> None |
|
|||
439 | o> readline() -> 2: |
|
|||
440 | o> 0\n |
|
|||
441 | i> write(4) -> 4: |
|
|||
442 | i> 426\n |
|
|||
443 | i> write(426) -> 426: |
|
|||
444 | 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 |
|
|||
445 | i> test\n |
|
|||
446 | i> 0 0\n |
|
|||
447 | i> foo\n |
|
|||
448 | i> \n |
|
|||
449 | 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 |
|
|||
450 | 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 |
|
|||
451 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
452 | i> write(2) -> 2: |
|
|||
453 | i> 0\n |
|
|||
454 | i> flush() -> None |
|
|||
455 | o> readline() -> 2: |
|
|||
456 | o> 0\n |
|
|||
457 | o> readline() -> 2: |
|
|||
458 | o> 1\n |
|
|||
459 | o> read(1) -> 1: 0 |
|
|||
460 | result: 0 |
|
|||
461 | remote output: |
|
|||
462 | e> read(-1) -> 173: |
|
|||
463 | e> adding changesets\n |
|
|||
464 | e> adding manifests\n |
|
|||
465 | e> adding file changes\n |
|
|||
466 | e> ui.write 2 lines 1\n |
|
|||
467 | e> ui.write 2 lines 2\n |
|
|||
468 | e> transaction abort!\n |
|
|||
469 | e> rollback completed\n |
|
|||
470 | e> abort: pretxnchangegroup.fail hook failed\n |
|
|||
471 |
|
297 | |||
472 | And a variation that does a ui.flush() after writing output |
|
298 | And a variation that does a ui.flush() after writing output | |
473 |
|
299 | |||
@@ -537,61 +363,6 b' And a variation that does a ui.flush() a' | |||||
537 | e> transaction abort!\n |
|
363 | e> transaction abort!\n | |
538 | e> rollback completed\n |
|
364 | e> rollback completed\n | |
539 | e> abort: pretxnchangegroup.fail hook failed\n |
|
365 | e> abort: pretxnchangegroup.fail hook failed\n | |
540 |
|
||||
541 | testing ssh2 |
|
|||
542 | creating ssh peer from handshake results |
|
|||
543 | i> write(171) -> 171: |
|
|||
544 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
545 | i> hello\n |
|
|||
546 | i> between\n |
|
|||
547 | i> pairs 81\n |
|
|||
548 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
549 | i> flush() -> None |
|
|||
550 | o> readline() -> 62: |
|
|||
551 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
552 | o> readline() -> 4: |
|
|||
553 | o> 443\n |
|
|||
554 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
555 | o> read(1) -> 1: |
|
|||
556 | o> \n |
|
|||
557 | sending unbundle command |
|
|||
558 | i> write(9) -> 9: |
|
|||
559 | i> unbundle\n |
|
|||
560 | i> write(9) -> 9: |
|
|||
561 | i> heads 10\n |
|
|||
562 | i> write(10) -> 10: 666f726365 |
|
|||
563 | i> flush() -> None |
|
|||
564 | o> readline() -> 2: |
|
|||
565 | o> 0\n |
|
|||
566 | i> write(4) -> 4: |
|
|||
567 | i> 426\n |
|
|||
568 | i> write(426) -> 426: |
|
|||
569 | 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 |
|
|||
570 | i> test\n |
|
|||
571 | i> 0 0\n |
|
|||
572 | i> foo\n |
|
|||
573 | i> \n |
|
|||
574 | 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 |
|
|||
575 | 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 |
|
|||
576 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
577 | i> write(2) -> 2: |
|
|||
578 | i> 0\n |
|
|||
579 | i> flush() -> None |
|
|||
580 | o> readline() -> 2: |
|
|||
581 | o> 0\n |
|
|||
582 | o> readline() -> 2: |
|
|||
583 | o> 1\n |
|
|||
584 | o> read(1) -> 1: 0 |
|
|||
585 | result: 0 |
|
|||
586 | remote output: |
|
|||
587 | e> read(-1) -> 157: |
|
|||
588 | e> adding changesets\n |
|
|||
589 | e> adding manifests\n |
|
|||
590 | e> adding file changes\n |
|
|||
591 | e> ui.write 1 line flush\n |
|
|||
592 | e> transaction abort!\n |
|
|||
593 | e> rollback completed\n |
|
|||
594 | e> abort: pretxnchangegroup.fail hook failed\n |
|
|||
595 |
|
366 | |||
596 | Multiple writes + flush |
|
367 | Multiple writes + flush | |
597 |
|
368 | |||
@@ -662,62 +433,6 b' Multiple writes + flush' | |||||
662 | e> transaction abort!\n |
|
433 | e> transaction abort!\n | |
663 | e> rollback completed\n |
|
434 | e> rollback completed\n | |
664 | e> abort: pretxnchangegroup.fail hook failed\n |
|
435 | e> abort: pretxnchangegroup.fail hook failed\n | |
665 |
|
||||
666 | testing ssh2 |
|
|||
667 | creating ssh peer from handshake results |
|
|||
668 | i> write(171) -> 171: |
|
|||
669 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
670 | i> hello\n |
|
|||
671 | i> between\n |
|
|||
672 | i> pairs 81\n |
|
|||
673 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
674 | i> flush() -> None |
|
|||
675 | o> readline() -> 62: |
|
|||
676 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
677 | o> readline() -> 4: |
|
|||
678 | o> 443\n |
|
|||
679 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
680 | o> read(1) -> 1: |
|
|||
681 | o> \n |
|
|||
682 | sending unbundle command |
|
|||
683 | i> write(9) -> 9: |
|
|||
684 | i> unbundle\n |
|
|||
685 | i> write(9) -> 9: |
|
|||
686 | i> heads 10\n |
|
|||
687 | i> write(10) -> 10: 666f726365 |
|
|||
688 | i> flush() -> None |
|
|||
689 | o> readline() -> 2: |
|
|||
690 | o> 0\n |
|
|||
691 | i> write(4) -> 4: |
|
|||
692 | i> 426\n |
|
|||
693 | i> write(426) -> 426: |
|
|||
694 | 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 |
|
|||
695 | i> test\n |
|
|||
696 | i> 0 0\n |
|
|||
697 | i> foo\n |
|
|||
698 | i> \n |
|
|||
699 | 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 |
|
|||
700 | 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 |
|
|||
701 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
702 | i> write(2) -> 2: |
|
|||
703 | i> 0\n |
|
|||
704 | i> flush() -> None |
|
|||
705 | o> readline() -> 2: |
|
|||
706 | o> 0\n |
|
|||
707 | o> readline() -> 2: |
|
|||
708 | o> 1\n |
|
|||
709 | o> read(1) -> 1: 0 |
|
|||
710 | result: 0 |
|
|||
711 | remote output: |
|
|||
712 | e> read(-1) -> 161: |
|
|||
713 | e> adding changesets\n |
|
|||
714 | e> adding manifests\n |
|
|||
715 | e> adding file changes\n |
|
|||
716 | e> ui.write 1st\n |
|
|||
717 | e> ui.write 2nd\n |
|
|||
718 | e> transaction abort!\n |
|
|||
719 | e> rollback completed\n |
|
|||
720 | e> abort: pretxnchangegroup.fail hook failed\n |
|
|||
721 |
|
436 | |||
722 | ui.write() + ui.write_err() output is captured |
|
437 | ui.write() + ui.write_err() output is captured | |
723 |
|
438 | |||
@@ -790,64 +505,7 b' ui.write() + ui.write_err() output is ca' | |||||
790 | e> transaction abort!\n |
|
505 | e> transaction abort!\n | |
791 | e> rollback completed\n |
|
506 | e> rollback completed\n | |
792 | e> abort: pretxnchangegroup.fail hook failed\n |
|
507 | e> abort: pretxnchangegroup.fail hook failed\n | |
793 |
|
508 | |||
794 | testing ssh2 |
|
|||
795 | creating ssh peer from handshake results |
|
|||
796 | i> write(171) -> 171: |
|
|||
797 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
798 | i> hello\n |
|
|||
799 | i> between\n |
|
|||
800 | i> pairs 81\n |
|
|||
801 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
802 | i> flush() -> None |
|
|||
803 | o> readline() -> 62: |
|
|||
804 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
805 | o> readline() -> 4: |
|
|||
806 | o> 443\n |
|
|||
807 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
808 | o> read(1) -> 1: |
|
|||
809 | o> \n |
|
|||
810 | sending unbundle command |
|
|||
811 | i> write(9) -> 9: |
|
|||
812 | i> unbundle\n |
|
|||
813 | i> write(9) -> 9: |
|
|||
814 | i> heads 10\n |
|
|||
815 | i> write(10) -> 10: 666f726365 |
|
|||
816 | i> flush() -> None |
|
|||
817 | o> readline() -> 2: |
|
|||
818 | o> 0\n |
|
|||
819 | i> write(4) -> 4: |
|
|||
820 | i> 426\n |
|
|||
821 | i> write(426) -> 426: |
|
|||
822 | 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 |
|
|||
823 | i> test\n |
|
|||
824 | i> 0 0\n |
|
|||
825 | i> foo\n |
|
|||
826 | i> \n |
|
|||
827 | 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 |
|
|||
828 | 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 |
|
|||
829 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
830 | i> write(2) -> 2: |
|
|||
831 | i> 0\n |
|
|||
832 | i> flush() -> None |
|
|||
833 | o> readline() -> 2: |
|
|||
834 | o> 0\n |
|
|||
835 | o> readline() -> 2: |
|
|||
836 | o> 1\n |
|
|||
837 | o> read(1) -> 1: 0 |
|
|||
838 | result: 0 |
|
|||
839 | remote output: |
|
|||
840 | e> read(-1) -> 187: |
|
|||
841 | e> adding changesets\n |
|
|||
842 | e> adding manifests\n |
|
|||
843 | e> adding file changes\n |
|
|||
844 | e> ui.write 1\n |
|
|||
845 | e> ui.write_err 1\n |
|
|||
846 | e> ui.write 2\n |
|
|||
847 | e> ui.write_err 2\n |
|
|||
848 | e> transaction abort!\n |
|
|||
849 | e> rollback completed\n |
|
|||
850 | e> abort: pretxnchangegroup.fail hook failed\n |
|
|||
851 |
|
509 | |||
852 | print() output is captured |
|
510 | print() output is captured | |
853 |
|
511 | |||
@@ -917,61 +575,6 b' print() output is captured' | |||||
917 | e> transaction abort!\n |
|
575 | e> transaction abort!\n | |
918 | e> rollback completed\n |
|
576 | e> rollback completed\n | |
919 | e> abort: pretxnchangegroup.fail hook failed\n |
|
577 | e> abort: pretxnchangegroup.fail hook failed\n | |
920 |
|
||||
921 | testing ssh2 |
|
|||
922 | creating ssh peer from handshake results |
|
|||
923 | i> write(171) -> 171: |
|
|||
924 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
925 | i> hello\n |
|
|||
926 | i> between\n |
|
|||
927 | i> pairs 81\n |
|
|||
928 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
929 | i> flush() -> None |
|
|||
930 | o> readline() -> 62: |
|
|||
931 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
932 | o> readline() -> 4: |
|
|||
933 | o> 443\n |
|
|||
934 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
935 | o> read(1) -> 1: |
|
|||
936 | o> \n |
|
|||
937 | sending unbundle command |
|
|||
938 | i> write(9) -> 9: |
|
|||
939 | i> unbundle\n |
|
|||
940 | i> write(9) -> 9: |
|
|||
941 | i> heads 10\n |
|
|||
942 | i> write(10) -> 10: 666f726365 |
|
|||
943 | i> flush() -> None |
|
|||
944 | o> readline() -> 2: |
|
|||
945 | o> 0\n |
|
|||
946 | i> write(4) -> 4: |
|
|||
947 | i> 426\n |
|
|||
948 | i> write(426) -> 426: |
|
|||
949 | 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 |
|
|||
950 | i> test\n |
|
|||
951 | i> 0 0\n |
|
|||
952 | i> foo\n |
|
|||
953 | i> \n |
|
|||
954 | 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 |
|
|||
955 | 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 |
|
|||
956 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
957 | i> write(2) -> 2: |
|
|||
958 | i> 0\n |
|
|||
959 | i> flush() -> None |
|
|||
960 | o> readline() -> 2: |
|
|||
961 | o> 0\n |
|
|||
962 | o> readline() -> 2: |
|
|||
963 | o> 1\n |
|
|||
964 | o> read(1) -> 1: 0 |
|
|||
965 | result: 0 |
|
|||
966 | remote output: |
|
|||
967 | e> read(-1) -> 148: |
|
|||
968 | e> adding changesets\n |
|
|||
969 | e> adding manifests\n |
|
|||
970 | e> adding file changes\n |
|
|||
971 | e> printed line\n |
|
|||
972 | e> transaction abort!\n |
|
|||
973 | e> rollback completed\n |
|
|||
974 | e> abort: pretxnchangegroup.fail hook failed\n |
|
|||
975 |
|
578 | |||
976 | Mixed print() and ui.write() are both captured |
|
579 | Mixed print() and ui.write() are both captured | |
977 |
|
580 | |||
@@ -1044,64 +647,6 b' Mixed print() and ui.write() are both ca' | |||||
1044 | e> transaction abort!\n |
|
647 | e> transaction abort!\n | |
1045 | e> rollback completed\n |
|
648 | e> rollback completed\n | |
1046 | e> abort: pretxnchangegroup.fail hook failed\n |
|
649 | e> abort: pretxnchangegroup.fail hook failed\n | |
1047 |
|
||||
1048 | testing ssh2 |
|
|||
1049 | creating ssh peer from handshake results |
|
|||
1050 | i> write(171) -> 171: |
|
|||
1051 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1052 | i> hello\n |
|
|||
1053 | i> between\n |
|
|||
1054 | i> pairs 81\n |
|
|||
1055 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1056 | i> flush() -> None |
|
|||
1057 | o> readline() -> 62: |
|
|||
1058 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1059 | o> readline() -> 4: |
|
|||
1060 | o> 443\n |
|
|||
1061 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1062 | o> read(1) -> 1: |
|
|||
1063 | o> \n |
|
|||
1064 | sending unbundle command |
|
|||
1065 | i> write(9) -> 9: |
|
|||
1066 | i> unbundle\n |
|
|||
1067 | i> write(9) -> 9: |
|
|||
1068 | i> heads 10\n |
|
|||
1069 | i> write(10) -> 10: 666f726365 |
|
|||
1070 | i> flush() -> None |
|
|||
1071 | o> readline() -> 2: |
|
|||
1072 | o> 0\n |
|
|||
1073 | i> write(4) -> 4: |
|
|||
1074 | i> 426\n |
|
|||
1075 | i> write(426) -> 426: |
|
|||
1076 | 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 |
|
|||
1077 | i> test\n |
|
|||
1078 | i> 0 0\n |
|
|||
1079 | i> foo\n |
|
|||
1080 | i> \n |
|
|||
1081 | 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 |
|
|||
1082 | 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 |
|
|||
1083 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
1084 | i> write(2) -> 2: |
|
|||
1085 | i> 0\n |
|
|||
1086 | i> flush() -> None |
|
|||
1087 | o> readline() -> 2: |
|
|||
1088 | o> 0\n |
|
|||
1089 | o> readline() -> 2: |
|
|||
1090 | o> 1\n |
|
|||
1091 | o> read(1) -> 1: 0 |
|
|||
1092 | result: 0 |
|
|||
1093 | remote output: |
|
|||
1094 | e> read(-1) -> 173: |
|
|||
1095 | e> adding changesets\n |
|
|||
1096 | e> adding manifests\n |
|
|||
1097 | e> adding file changes\n |
|
|||
1098 | e> print 1\n |
|
|||
1099 | e> ui.write 1\n |
|
|||
1100 | e> print 2\n |
|
|||
1101 | e> ui.write 2\n |
|
|||
1102 | e> transaction abort!\n |
|
|||
1103 | e> rollback completed\n |
|
|||
1104 | e> abort: pretxnchangegroup.fail hook failed\n |
|
|||
1105 |
|
650 | |||
1106 | print() to stdout and stderr both get captured |
|
651 | print() to stdout and stderr both get captured | |
1107 |
|
652 | |||
@@ -1174,64 +719,6 b' print() to stdout and stderr both get ca' | |||||
1174 | e> transaction abort!\n |
|
719 | e> transaction abort!\n | |
1175 | e> rollback completed\n |
|
720 | e> rollback completed\n | |
1176 | e> abort: pretxnchangegroup.fail hook failed\n |
|
721 | e> abort: pretxnchangegroup.fail hook failed\n | |
1177 |
|
||||
1178 | testing ssh2 |
|
|||
1179 | creating ssh peer from handshake results |
|
|||
1180 | i> write(171) -> 171: |
|
|||
1181 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1182 | i> hello\n |
|
|||
1183 | i> between\n |
|
|||
1184 | i> pairs 81\n |
|
|||
1185 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1186 | i> flush() -> None |
|
|||
1187 | o> readline() -> 62: |
|
|||
1188 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1189 | o> readline() -> 4: |
|
|||
1190 | o> 443\n |
|
|||
1191 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1192 | o> read(1) -> 1: |
|
|||
1193 | o> \n |
|
|||
1194 | sending unbundle command |
|
|||
1195 | i> write(9) -> 9: |
|
|||
1196 | i> unbundle\n |
|
|||
1197 | i> write(9) -> 9: |
|
|||
1198 | i> heads 10\n |
|
|||
1199 | i> write(10) -> 10: 666f726365 |
|
|||
1200 | i> flush() -> None |
|
|||
1201 | o> readline() -> 2: |
|
|||
1202 | o> 0\n |
|
|||
1203 | i> write(4) -> 4: |
|
|||
1204 | i> 426\n |
|
|||
1205 | i> write(426) -> 426: |
|
|||
1206 | 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 |
|
|||
1207 | i> test\n |
|
|||
1208 | i> 0 0\n |
|
|||
1209 | i> foo\n |
|
|||
1210 | i> \n |
|
|||
1211 | 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 |
|
|||
1212 | 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 |
|
|||
1213 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
1214 | i> write(2) -> 2: |
|
|||
1215 | i> 0\n |
|
|||
1216 | i> flush() -> None |
|
|||
1217 | o> readline() -> 2: |
|
|||
1218 | o> 0\n |
|
|||
1219 | o> readline() -> 2: |
|
|||
1220 | o> 1\n |
|
|||
1221 | o> read(1) -> 1: 0 |
|
|||
1222 | result: 0 |
|
|||
1223 | remote output: |
|
|||
1224 | e> read(-1) -> 171: |
|
|||
1225 | e> adding changesets\n |
|
|||
1226 | e> adding manifests\n |
|
|||
1227 | e> adding file changes\n |
|
|||
1228 | e> stdout 1\n |
|
|||
1229 | e> stderr 1\n |
|
|||
1230 | e> stdout 2\n |
|
|||
1231 | e> stderr 2\n |
|
|||
1232 | e> transaction abort!\n |
|
|||
1233 | e> rollback completed\n |
|
|||
1234 | e> abort: pretxnchangegroup.fail hook failed\n |
|
|||
1235 |
|
722 | |||
1236 | Shell hook writing to stdout has output captured |
|
723 | Shell hook writing to stdout has output captured | |
1237 |
|
724 | |||
@@ -1308,63 +795,6 b' Shell hook writing to stdout has output ' | |||||
1308 | e> transaction abort!\n |
|
795 | e> transaction abort!\n | |
1309 | e> rollback completed\n |
|
796 | e> rollback completed\n | |
1310 | e> abort: pretxnchangegroup.fail hook exited with status 1\n |
|
797 | e> abort: pretxnchangegroup.fail hook exited with status 1\n | |
1311 |
|
||||
1312 | testing ssh2 |
|
|||
1313 | creating ssh peer from handshake results |
|
|||
1314 | i> write(171) -> 171: |
|
|||
1315 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1316 | i> hello\n |
|
|||
1317 | i> between\n |
|
|||
1318 | i> pairs 81\n |
|
|||
1319 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1320 | i> flush() -> None |
|
|||
1321 | o> readline() -> 62: |
|
|||
1322 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1323 | o> readline() -> 4: |
|
|||
1324 | o> 443\n |
|
|||
1325 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1326 | o> read(1) -> 1: |
|
|||
1327 | o> \n |
|
|||
1328 | sending unbundle command |
|
|||
1329 | i> write(9) -> 9: |
|
|||
1330 | i> unbundle\n |
|
|||
1331 | i> write(9) -> 9: |
|
|||
1332 | i> heads 10\n |
|
|||
1333 | i> write(10) -> 10: 666f726365 |
|
|||
1334 | i> flush() -> None |
|
|||
1335 | o> readline() -> 2: |
|
|||
1336 | o> 0\n |
|
|||
1337 | i> write(4) -> 4: |
|
|||
1338 | i> 426\n |
|
|||
1339 | i> write(426) -> 426: |
|
|||
1340 | 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 |
|
|||
1341 | i> test\n |
|
|||
1342 | i> 0 0\n |
|
|||
1343 | i> foo\n |
|
|||
1344 | i> \n |
|
|||
1345 | 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 |
|
|||
1346 | 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 |
|
|||
1347 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
1348 | i> write(2) -> 2: |
|
|||
1349 | i> 0\n |
|
|||
1350 | i> flush() -> None |
|
|||
1351 | o> readline() -> 2: |
|
|||
1352 | o> 0\n |
|
|||
1353 | o> readline() -> 2: |
|
|||
1354 | o> 1\n |
|
|||
1355 | o> read(1) -> 1: 0 |
|
|||
1356 | result: 0 |
|
|||
1357 | remote output: |
|
|||
1358 | e> read(-1) -> 167: |
|
|||
1359 | e> adding changesets\n |
|
|||
1360 | e> adding manifests\n |
|
|||
1361 | e> adding file changes\n |
|
|||
1362 | e> stdout 1\n |
|
|||
1363 | e> stdout 2\n |
|
|||
1364 | e> transaction abort!\n |
|
|||
1365 | e> rollback completed\n |
|
|||
1366 | e> abort: pretxnchangegroup.fail hook exited with status 1\n |
|
|||
1367 |
|
||||
1368 | Shell hook writing to stderr has output captured |
|
798 | Shell hook writing to stderr has output captured | |
1369 |
|
799 | |||
1370 | $ cat > $TESTTMP/hook.sh << EOF |
|
800 | $ cat > $TESTTMP/hook.sh << EOF | |
@@ -1435,63 +865,6 b' Shell hook writing to stderr has output ' | |||||
1435 | e> transaction abort!\n |
|
865 | e> transaction abort!\n | |
1436 | e> rollback completed\n |
|
866 | e> rollback completed\n | |
1437 | e> abort: pretxnchangegroup.fail hook exited with status 1\n |
|
867 | e> abort: pretxnchangegroup.fail hook exited with status 1\n | |
1438 |
|
||||
1439 | testing ssh2 |
|
|||
1440 | creating ssh peer from handshake results |
|
|||
1441 | i> write(171) -> 171: |
|
|||
1442 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1443 | i> hello\n |
|
|||
1444 | i> between\n |
|
|||
1445 | i> pairs 81\n |
|
|||
1446 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1447 | i> flush() -> None |
|
|||
1448 | o> readline() -> 62: |
|
|||
1449 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1450 | o> readline() -> 4: |
|
|||
1451 | o> 443\n |
|
|||
1452 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1453 | o> read(1) -> 1: |
|
|||
1454 | o> \n |
|
|||
1455 | sending unbundle command |
|
|||
1456 | i> write(9) -> 9: |
|
|||
1457 | i> unbundle\n |
|
|||
1458 | i> write(9) -> 9: |
|
|||
1459 | i> heads 10\n |
|
|||
1460 | i> write(10) -> 10: 666f726365 |
|
|||
1461 | i> flush() -> None |
|
|||
1462 | o> readline() -> 2: |
|
|||
1463 | o> 0\n |
|
|||
1464 | i> write(4) -> 4: |
|
|||
1465 | i> 426\n |
|
|||
1466 | i> write(426) -> 426: |
|
|||
1467 | 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 |
|
|||
1468 | i> test\n |
|
|||
1469 | i> 0 0\n |
|
|||
1470 | i> foo\n |
|
|||
1471 | i> \n |
|
|||
1472 | 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 |
|
|||
1473 | 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 |
|
|||
1474 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
1475 | i> write(2) -> 2: |
|
|||
1476 | i> 0\n |
|
|||
1477 | i> flush() -> None |
|
|||
1478 | o> readline() -> 2: |
|
|||
1479 | o> 0\n |
|
|||
1480 | o> readline() -> 2: |
|
|||
1481 | o> 1\n |
|
|||
1482 | o> read(1) -> 1: 0 |
|
|||
1483 | result: 0 |
|
|||
1484 | remote output: |
|
|||
1485 | e> read(-1) -> 167: |
|
|||
1486 | e> adding changesets\n |
|
|||
1487 | e> adding manifests\n |
|
|||
1488 | e> adding file changes\n |
|
|||
1489 | e> stderr 1\n |
|
|||
1490 | e> stderr 2\n |
|
|||
1491 | e> transaction abort!\n |
|
|||
1492 | e> rollback completed\n |
|
|||
1493 | e> abort: pretxnchangegroup.fail hook exited with status 1\n |
|
|||
1494 |
|
||||
1495 | Shell hook writing to stdout and stderr has output captured |
|
868 | Shell hook writing to stdout and stderr has output captured | |
1496 |
|
869 | |||
1497 | $ cat > $TESTTMP/hook.sh << EOF |
|
870 | $ cat > $TESTTMP/hook.sh << EOF | |
@@ -1566,65 +939,6 b' Shell hook writing to stdout and stderr ' | |||||
1566 | e> transaction abort!\n |
|
939 | e> transaction abort!\n | |
1567 | e> rollback completed\n |
|
940 | e> rollback completed\n | |
1568 | e> abort: pretxnchangegroup.fail hook exited with status 1\n |
|
941 | e> abort: pretxnchangegroup.fail hook exited with status 1\n | |
1569 |
|
||||
1570 | testing ssh2 |
|
|||
1571 | creating ssh peer from handshake results |
|
|||
1572 | i> write(171) -> 171: |
|
|||
1573 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1574 | i> hello\n |
|
|||
1575 | i> between\n |
|
|||
1576 | i> pairs 81\n |
|
|||
1577 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1578 | i> flush() -> None |
|
|||
1579 | o> readline() -> 62: |
|
|||
1580 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1581 | o> readline() -> 4: |
|
|||
1582 | o> 443\n |
|
|||
1583 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1584 | o> read(1) -> 1: |
|
|||
1585 | o> \n |
|
|||
1586 | sending unbundle command |
|
|||
1587 | i> write(9) -> 9: |
|
|||
1588 | i> unbundle\n |
|
|||
1589 | i> write(9) -> 9: |
|
|||
1590 | i> heads 10\n |
|
|||
1591 | i> write(10) -> 10: 666f726365 |
|
|||
1592 | i> flush() -> None |
|
|||
1593 | o> readline() -> 2: |
|
|||
1594 | o> 0\n |
|
|||
1595 | i> write(4) -> 4: |
|
|||
1596 | i> 426\n |
|
|||
1597 | i> write(426) -> 426: |
|
|||
1598 | 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 |
|
|||
1599 | i> test\n |
|
|||
1600 | i> 0 0\n |
|
|||
1601 | i> foo\n |
|
|||
1602 | i> \n |
|
|||
1603 | 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 |
|
|||
1604 | 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 |
|
|||
1605 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
1606 | i> write(2) -> 2: |
|
|||
1607 | i> 0\n |
|
|||
1608 | i> flush() -> None |
|
|||
1609 | o> readline() -> 2: |
|
|||
1610 | o> 0\n |
|
|||
1611 | o> readline() -> 2: |
|
|||
1612 | o> 1\n |
|
|||
1613 | o> read(1) -> 1: 0 |
|
|||
1614 | result: 0 |
|
|||
1615 | remote output: |
|
|||
1616 | e> read(-1) -> 185: |
|
|||
1617 | e> adding changesets\n |
|
|||
1618 | e> adding manifests\n |
|
|||
1619 | e> adding file changes\n |
|
|||
1620 | e> stdout 1\n |
|
|||
1621 | e> stderr 1\n |
|
|||
1622 | e> stdout 2\n |
|
|||
1623 | e> stderr 2\n |
|
|||
1624 | e> transaction abort!\n |
|
|||
1625 | e> rollback completed\n |
|
|||
1626 | e> abort: pretxnchangegroup.fail hook exited with status 1\n |
|
|||
1627 |
|
||||
1628 | Shell and Python hooks writing to stdout and stderr have output captured |
|
942 | Shell and Python hooks writing to stdout and stderr have output captured | |
1629 |
|
943 | |||
1630 | $ cat > $TESTTMP/hook.sh << EOF |
|
944 | $ cat > $TESTTMP/hook.sh << EOF | |
@@ -1709,69 +1023,6 b' Shell and Python hooks writing to stdout' | |||||
1709 | e> transaction abort!\n |
|
1023 | e> transaction abort!\n | |
1710 | e> rollback completed\n |
|
1024 | e> rollback completed\n | |
1711 | e> abort: pretxnchangegroup.b hook failed\n |
|
1025 | e> abort: pretxnchangegroup.b hook failed\n | |
1712 |
|
||||
1713 | testing ssh2 |
|
|||
1714 | creating ssh peer from handshake results |
|
|||
1715 | i> write(171) -> 171: |
|
|||
1716 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1717 | i> hello\n |
|
|||
1718 | i> between\n |
|
|||
1719 | i> pairs 81\n |
|
|||
1720 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1721 | i> flush() -> None |
|
|||
1722 | o> readline() -> 62: |
|
|||
1723 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1724 | o> readline() -> 4: |
|
|||
1725 | o> 443\n |
|
|||
1726 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1727 | o> read(1) -> 1: |
|
|||
1728 | o> \n |
|
|||
1729 | sending unbundle command |
|
|||
1730 | i> write(9) -> 9: |
|
|||
1731 | i> unbundle\n |
|
|||
1732 | i> write(9) -> 9: |
|
|||
1733 | i> heads 10\n |
|
|||
1734 | i> write(10) -> 10: 666f726365 |
|
|||
1735 | i> flush() -> None |
|
|||
1736 | o> readline() -> 2: |
|
|||
1737 | o> 0\n |
|
|||
1738 | i> write(4) -> 4: |
|
|||
1739 | i> 426\n |
|
|||
1740 | i> write(426) -> 426: |
|
|||
1741 | 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 |
|
|||
1742 | i> test\n |
|
|||
1743 | i> 0 0\n |
|
|||
1744 | i> foo\n |
|
|||
1745 | i> \n |
|
|||
1746 | 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 |
|
|||
1747 | 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 |
|
|||
1748 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
1749 | i> write(2) -> 2: |
|
|||
1750 | i> 0\n |
|
|||
1751 | i> flush() -> None |
|
|||
1752 | o> readline() -> 2: |
|
|||
1753 | o> 0\n |
|
|||
1754 | o> readline() -> 2: |
|
|||
1755 | o> 1\n |
|
|||
1756 | o> read(1) -> 1: 0 |
|
|||
1757 | result: 0 |
|
|||
1758 | remote output: |
|
|||
1759 | e> read(-1) -> 228: |
|
|||
1760 | e> adding changesets\n |
|
|||
1761 | e> adding manifests\n |
|
|||
1762 | e> adding file changes\n |
|
|||
1763 | e> shell stdout 1\n |
|
|||
1764 | e> shell stderr 1\n |
|
|||
1765 | e> shell stdout 2\n |
|
|||
1766 | e> shell stderr 2\n |
|
|||
1767 | e> stdout 1\n |
|
|||
1768 | e> stderr 1\n |
|
|||
1769 | e> stdout 2\n |
|
|||
1770 | e> stderr 2\n |
|
|||
1771 | e> transaction abort!\n |
|
|||
1772 | e> rollback completed\n |
|
|||
1773 | e> abort: pretxnchangegroup.b hook failed\n |
|
|||
1774 |
|
||||
1775 | $ cd .. |
|
1026 | $ cd .. | |
1776 |
|
1027 | |||
1777 | Pushing a bundle1 with no output |
|
1028 | Pushing a bundle1 with no output | |
@@ -1837,59 +1088,6 b' Pushing a bundle1 with no output' | |||||
1837 | e> adding manifests\n |
|
1088 | e> adding manifests\n | |
1838 | e> adding file changes\n |
|
1089 | e> adding file changes\n | |
1839 | e> added 1 changesets with 1 changes to 1 files\n |
|
1090 | e> added 1 changesets with 1 changes to 1 files\n | |
1840 |
|
||||
1841 | testing ssh2 |
|
|||
1842 | creating ssh peer from handshake results |
|
|||
1843 | i> write(171) -> 171: |
|
|||
1844 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1845 | i> hello\n |
|
|||
1846 | i> between\n |
|
|||
1847 | i> pairs 81\n |
|
|||
1848 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1849 | i> flush() -> None |
|
|||
1850 | o> readline() -> 62: |
|
|||
1851 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1852 | o> readline() -> 4: |
|
|||
1853 | o> 443\n |
|
|||
1854 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1855 | o> read(1) -> 1: |
|
|||
1856 | o> \n |
|
|||
1857 | sending unbundle command |
|
|||
1858 | i> write(9) -> 9: |
|
|||
1859 | i> unbundle\n |
|
|||
1860 | i> write(9) -> 9: |
|
|||
1861 | i> heads 10\n |
|
|||
1862 | i> write(10) -> 10: 666f726365 |
|
|||
1863 | i> flush() -> None |
|
|||
1864 | o> readline() -> 2: |
|
|||
1865 | o> 0\n |
|
|||
1866 | i> write(4) -> 4: |
|
|||
1867 | i> 426\n |
|
|||
1868 | i> write(426) -> 426: |
|
|||
1869 | 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 |
|
|||
1870 | i> test\n |
|
|||
1871 | i> 0 0\n |
|
|||
1872 | i> foo\n |
|
|||
1873 | i> \n |
|
|||
1874 | 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 |
|
|||
1875 | 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 |
|
|||
1876 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
1877 | i> write(2) -> 2: |
|
|||
1878 | i> 0\n |
|
|||
1879 | i> flush() -> None |
|
|||
1880 | o> readline() -> 2: |
|
|||
1881 | o> 0\n |
|
|||
1882 | o> readline() -> 2: |
|
|||
1883 | o> 1\n |
|
|||
1884 | o> read(1) -> 1: 1 |
|
|||
1885 | result: 1 |
|
|||
1886 | remote output: |
|
|||
1887 | e> read(-1) -> 100: |
|
|||
1888 | e> adding changesets\n |
|
|||
1889 | e> adding manifests\n |
|
|||
1890 | e> adding file changes\n |
|
|||
1891 | e> added 1 changesets with 1 changes to 1 files\n |
|
|||
1892 |
|
||||
1893 | $ cd .. |
|
1091 | $ cd .. | |
1894 |
|
1092 | |||
1895 | Pushing a bundle1 with ui.write() and ui.write_err() |
|
1093 | Pushing a bundle1 with ui.write() and ui.write_err() | |
@@ -1971,59 +1169,3 b' Pushing a bundle1 with ui.write() and ui' | |||||
1971 | e> ui.write 2\n |
|
1169 | e> ui.write 2\n | |
1972 | e> ui.write_err 2\n |
|
1170 | e> ui.write_err 2\n | |
1973 | e> added 1 changesets with 1 changes to 1 files\n |
|
1171 | e> added 1 changesets with 1 changes to 1 files\n | |
1974 |
|
||||
1975 | testing ssh2 |
|
|||
1976 | creating ssh peer from handshake results |
|
|||
1977 | i> write(171) -> 171: |
|
|||
1978 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1979 | i> hello\n |
|
|||
1980 | i> between\n |
|
|||
1981 | i> pairs 81\n |
|
|||
1982 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1983 | i> flush() -> None |
|
|||
1984 | o> readline() -> 62: |
|
|||
1985 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1986 | o> readline() -> 4: |
|
|||
1987 | o> 443\n |
|
|||
1988 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1989 | o> read(1) -> 1: |
|
|||
1990 | o> \n |
|
|||
1991 | sending unbundle command |
|
|||
1992 | i> write(9) -> 9: |
|
|||
1993 | i> unbundle\n |
|
|||
1994 | i> write(9) -> 9: |
|
|||
1995 | i> heads 10\n |
|
|||
1996 | i> write(10) -> 10: 666f726365 |
|
|||
1997 | i> flush() -> None |
|
|||
1998 | o> readline() -> 2: |
|
|||
1999 | o> 0\n |
|
|||
2000 | i> write(4) -> 4: |
|
|||
2001 | i> 426\n |
|
|||
2002 | i> write(426) -> 426: |
|
|||
2003 | 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 |
|
|||
2004 | i> test\n |
|
|||
2005 | i> 0 0\n |
|
|||
2006 | i> foo\n |
|
|||
2007 | i> \n |
|
|||
2008 | 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 |
|
|||
2009 | 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 |
|
|||
2010 | i> \x00\x00\x00\x00\x00\x00\x00\x00 |
|
|||
2011 | i> write(2) -> 2: |
|
|||
2012 | i> 0\n |
|
|||
2013 | i> flush() -> None |
|
|||
2014 | o> readline() -> 2: |
|
|||
2015 | o> 0\n |
|
|||
2016 | o> readline() -> 2: |
|
|||
2017 | o> 1\n |
|
|||
2018 | o> read(1) -> 1: 1 |
|
|||
2019 | result: 1 |
|
|||
2020 | remote output: |
|
|||
2021 | e> read(-1) -> 152: |
|
|||
2022 | e> adding changesets\n |
|
|||
2023 | e> adding manifests\n |
|
|||
2024 | e> adding file changes\n |
|
|||
2025 | e> ui.write 1\n |
|
|||
2026 | e> ui.write_err 1\n |
|
|||
2027 | e> ui.write 2\n |
|
|||
2028 | e> ui.write_err 2\n |
|
|||
2029 | e> added 1 changesets with 1 changes to 1 files\n |
|
This diff has been collapsed as it changes many lines, (782 lines changed) Show them Hide them | |||||
@@ -7,13 +7,6 b' persistent-nodemap is not enabled by def' | |||||
7 | > use-persistent-nodemap = no |
|
7 | > use-persistent-nodemap = no | |
8 | > EOF |
|
8 | > EOF | |
9 |
|
9 | |||
10 | $ cat > hgrc-sshv2 << EOF |
|
|||
11 | > %include $HGRCPATH |
|
|||
12 | > [experimental] |
|
|||
13 | > sshpeer.advertise-v2 = true |
|
|||
14 | > sshserver.support-v2 = true |
|
|||
15 | > EOF |
|
|||
16 |
|
||||
17 | Helper function to run protocol tests against multiple protocol versions. |
|
10 | Helper function to run protocol tests against multiple protocol versions. | |
18 | This is easier than using #testcases because managing differences between |
|
11 | This is easier than using #testcases because managing differences between | |
19 | protocols with inline conditional output is hard to read. |
|
12 | protocols with inline conditional output is hard to read. | |
@@ -22,9 +15,6 b' protocols with inline conditional output' | |||||
22 | > commands=`cat -` |
|
15 | > commands=`cat -` | |
23 | > echo 'testing ssh1' |
|
16 | > echo 'testing ssh1' | |
24 | > echo "${commands}" | hg --verbose debugwireproto --localssh |
|
17 | > echo "${commands}" | hg --verbose debugwireproto --localssh | |
25 | > echo "" |
|
|||
26 | > echo 'testing ssh2' |
|
|||
27 | > echo "${commands}" | HGRCPATH=$TESTTMP/hgrc-sshv2 hg --verbose debugwireproto --localssh |
|
|||
28 | > } |
|
18 | > } | |
29 |
|
19 | |||
30 | $ cat >> $HGRCPATH << EOF |
|
20 | $ cat >> $HGRCPATH << EOF | |
@@ -54,9 +44,6 b" Raw peers don't perform any activity" | |||||
54 | $ hg debugwireproto --localssh --peer ssh1 << EOF |
|
44 | $ hg debugwireproto --localssh --peer ssh1 << EOF | |
55 | > EOF |
|
45 | > EOF | |
56 | creating ssh peer for wire protocol version 1 |
|
46 | creating ssh peer for wire protocol version 1 | |
57 | $ hg debugwireproto --localssh --peer ssh2 << EOF |
|
|||
58 | > EOF |
|
|||
59 | creating ssh peer for wire protocol version 2 |
|
|||
60 |
|
47 | |||
61 | Test a normal behaving server, for sanity |
|
48 | Test a normal behaving server, for sanity | |
62 |
|
49 | |||
@@ -916,410 +903,6 b" And a variation that doesn't send the be" | |||||
916 | o> readline() -> 4: |
|
903 | o> readline() -> 4: | |
917 | o> 444\n |
|
904 | o> 444\n | |
918 |
|
905 | |||
919 | Send an upgrade request to a server that doesn't support that command |
|
|||
920 |
|
||||
921 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
922 | > raw |
|
|||
923 | > upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=irrelevant1%2Cirrelevant2\n |
|
|||
924 | > readline |
|
|||
925 | > raw |
|
|||
926 | > hello\n |
|
|||
927 | > between\n |
|
|||
928 | > pairs 81\n |
|
|||
929 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
930 | > readline |
|
|||
931 | > readline |
|
|||
932 | > readline |
|
|||
933 | > readline |
|
|||
934 | > EOF |
|
|||
935 | using raw connection to peer |
|
|||
936 | i> write(77) -> 77: |
|
|||
937 | i> upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=irrelevant1%2Cirrelevant2\n |
|
|||
938 | o> readline() -> 2: |
|
|||
939 | o> 0\n |
|
|||
940 | i> write(104) -> 104: |
|
|||
941 | i> hello\n |
|
|||
942 | i> between\n |
|
|||
943 | i> pairs 81\n |
|
|||
944 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
945 | o> readline() -> 4: |
|
|||
946 | o> 444\n |
|
|||
947 | o> readline() -> 444: |
|
|||
948 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n |
|
|||
949 | o> readline() -> 2: |
|
|||
950 | o> 1\n |
|
|||
951 | o> readline() -> 1: |
|
|||
952 | o> \n |
|
|||
953 |
|
||||
954 | $ cd .. |
|
|||
955 |
|
||||
956 | $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server |
|
|||
957 | running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R server serve --stdio['"] (re) |
|
|||
958 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) |
|
|||
959 | devel-peer-request: hello+between |
|
|||
960 | devel-peer-request: pairs: 81 bytes |
|
|||
961 | sending hello command |
|
|||
962 | sending between command |
|
|||
963 | remote: 0 |
|
|||
964 | remote: 444 |
|
|||
965 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
966 | remote: 1 |
|
|||
967 | devel-peer-request: protocaps |
|
|||
968 | devel-peer-request: caps: * bytes (glob) |
|
|||
969 | sending protocaps command |
|
|||
970 | url: ssh://user@dummy/server |
|
|||
971 | local: no |
|
|||
972 | pushable: yes |
|
|||
973 |
|
||||
974 | Enable version 2 support on server. We need to do this in hgrc because we can't |
|
|||
975 | use --config with `hg serve --stdio`. |
|
|||
976 |
|
||||
977 | $ cat >> server/.hg/hgrc << EOF |
|
|||
978 | > [experimental] |
|
|||
979 | > sshserver.support-v2 = true |
|
|||
980 | > EOF |
|
|||
981 |
|
||||
982 | Send an upgrade request to a server that supports upgrade |
|
|||
983 |
|
||||
984 | $ cd server |
|
|||
985 |
|
||||
986 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
987 | > raw |
|
|||
988 | > upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
|||
989 | > hello\n |
|
|||
990 | > between\n |
|
|||
991 | > pairs 81\n |
|
|||
992 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
993 | > readline |
|
|||
994 | > readline |
|
|||
995 | > readline |
|
|||
996 | > EOF |
|
|||
997 | using raw connection to peer |
|
|||
998 | i> write(153) -> 153: |
|
|||
999 | i> upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
|||
1000 | i> hello\n |
|
|||
1001 | i> between\n |
|
|||
1002 | i> pairs 81\n |
|
|||
1003 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1004 | o> readline() -> 44: |
|
|||
1005 | o> upgraded this-is-some-token exp-ssh-v2-0003\n |
|
|||
1006 | o> readline() -> 4: |
|
|||
1007 | o> 443\n |
|
|||
1008 | o> readline() -> 444: |
|
|||
1009 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n |
|
|||
1010 |
|
||||
1011 | $ cd .. |
|
|||
1012 |
|
||||
1013 | $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server |
|
|||
1014 | running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R server serve --stdio['"] (re) |
|
|||
1015 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) |
|
|||
1016 | devel-peer-request: hello+between |
|
|||
1017 | devel-peer-request: pairs: 81 bytes |
|
|||
1018 | sending hello command |
|
|||
1019 | sending between command |
|
|||
1020 | protocol upgraded to exp-ssh-v2-0003 |
|
|||
1021 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1022 | devel-peer-request: protocaps |
|
|||
1023 | devel-peer-request: caps: * bytes (glob) |
|
|||
1024 | sending protocaps command |
|
|||
1025 | url: ssh://user@dummy/server |
|
|||
1026 | local: no |
|
|||
1027 | pushable: yes |
|
|||
1028 |
|
||||
1029 | Verify the peer has capabilities |
|
|||
1030 |
|
||||
1031 | $ hg --config experimental.sshpeer.advertise-v2=true --debug debugcapabilities ssh://user@dummy/server |
|
|||
1032 | running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R server serve --stdio['"] (re) |
|
|||
1033 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) |
|
|||
1034 | devel-peer-request: hello+between |
|
|||
1035 | devel-peer-request: pairs: 81 bytes |
|
|||
1036 | sending hello command |
|
|||
1037 | sending between command |
|
|||
1038 | protocol upgraded to exp-ssh-v2-0003 |
|
|||
1039 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1040 | devel-peer-request: protocaps |
|
|||
1041 | devel-peer-request: caps: * bytes (glob) |
|
|||
1042 | sending protocaps command |
|
|||
1043 | Main capabilities: |
|
|||
1044 | batch |
|
|||
1045 | branchmap |
|
|||
1046 | $USUAL_BUNDLE2_CAPS$ |
|
|||
1047 | changegroupsubset |
|
|||
1048 | getbundle |
|
|||
1049 | known |
|
|||
1050 | lookup |
|
|||
1051 | protocaps |
|
|||
1052 | pushkey |
|
|||
1053 | streamreqs=generaldelta,revlogv1,sparserevlog |
|
|||
1054 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
|||
1055 | unbundlehash |
|
|||
1056 | Bundle2 capabilities: |
|
|||
1057 | HG20 |
|
|||
1058 | bookmarks |
|
|||
1059 | changegroup |
|
|||
1060 | 01 |
|
|||
1061 | 02 |
|
|||
1062 | checkheads |
|
|||
1063 | related |
|
|||
1064 | digests |
|
|||
1065 | md5 |
|
|||
1066 | sha1 |
|
|||
1067 | sha512 |
|
|||
1068 | error |
|
|||
1069 | abort |
|
|||
1070 | unsupportedcontent |
|
|||
1071 | pushraced |
|
|||
1072 | pushkey |
|
|||
1073 | hgtagsfnodes |
|
|||
1074 | listkeys |
|
|||
1075 | phases |
|
|||
1076 | heads |
|
|||
1077 | pushkey |
|
|||
1078 | remote-changegroup |
|
|||
1079 | http |
|
|||
1080 | https |
|
|||
1081 | stream |
|
|||
1082 | v2 |
|
|||
1083 |
|
||||
1084 | Command after upgrade to version 2 is processed |
|
|||
1085 |
|
||||
1086 | $ cd server |
|
|||
1087 |
|
||||
1088 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1089 | > raw |
|
|||
1090 | > upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
|||
1091 | > hello\n |
|
|||
1092 | > between\n |
|
|||
1093 | > pairs 81\n |
|
|||
1094 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1095 | > readline |
|
|||
1096 | > readline |
|
|||
1097 | > readline |
|
|||
1098 | > raw |
|
|||
1099 | > hello\n |
|
|||
1100 | > readline |
|
|||
1101 | > readline |
|
|||
1102 | > EOF |
|
|||
1103 | using raw connection to peer |
|
|||
1104 | i> write(153) -> 153: |
|
|||
1105 | i> upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
|||
1106 | i> hello\n |
|
|||
1107 | i> between\n |
|
|||
1108 | i> pairs 81\n |
|
|||
1109 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1110 | o> readline() -> 44: |
|
|||
1111 | o> upgraded this-is-some-token exp-ssh-v2-0003\n |
|
|||
1112 | o> readline() -> 4: |
|
|||
1113 | o> 443\n |
|
|||
1114 | o> readline() -> 444: |
|
|||
1115 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n |
|
|||
1116 | i> write(6) -> 6: |
|
|||
1117 | i> hello\n |
|
|||
1118 | o> readline() -> 4: |
|
|||
1119 | o> 428\n |
|
|||
1120 | o> readline() -> 428: |
|
|||
1121 | o> capabilities: branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n |
|
|||
1122 |
|
||||
1123 | Multiple upgrades is not allowed |
|
|||
1124 |
|
||||
1125 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1126 | > raw |
|
|||
1127 | > upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
|||
1128 | > hello\n |
|
|||
1129 | > between\n |
|
|||
1130 | > pairs 81\n |
|
|||
1131 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1132 | > readline |
|
|||
1133 | > readline |
|
|||
1134 | > readline |
|
|||
1135 | > raw |
|
|||
1136 | > upgrade another-token proto=irrelevant\n |
|
|||
1137 | > hello\n |
|
|||
1138 | > readline |
|
|||
1139 | > readavailable |
|
|||
1140 | > EOF |
|
|||
1141 | using raw connection to peer |
|
|||
1142 | i> write(153) -> 153: |
|
|||
1143 | i> upgrade this-is-some-token proto=exp-ssh-v2-0003\n |
|
|||
1144 | i> hello\n |
|
|||
1145 | i> between\n |
|
|||
1146 | i> pairs 81\n |
|
|||
1147 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1148 | o> readline() -> 44: |
|
|||
1149 | o> upgraded this-is-some-token exp-ssh-v2-0003\n |
|
|||
1150 | o> readline() -> 4: |
|
|||
1151 | o> 443\n |
|
|||
1152 | o> readline() -> 444: |
|
|||
1153 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n |
|
|||
1154 | i> write(45) -> 45: |
|
|||
1155 | i> upgrade another-token proto=irrelevant\n |
|
|||
1156 | i> hello\n |
|
|||
1157 | o> readline() -> 1: |
|
|||
1158 | o> \n |
|
|||
1159 | e> read(-1) -> 42: |
|
|||
1160 | e> cannot upgrade protocols multiple times\n |
|
|||
1161 | e> -\n |
|
|||
1162 |
|
||||
1163 | Malformed upgrade request line (not exactly 3 space delimited tokens) |
|
|||
1164 |
|
||||
1165 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1166 | > raw |
|
|||
1167 | > upgrade\n |
|
|||
1168 | > readline |
|
|||
1169 | > EOF |
|
|||
1170 | using raw connection to peer |
|
|||
1171 | i> write(8) -> 8: |
|
|||
1172 | i> upgrade\n |
|
|||
1173 | o> readline() -> 2: |
|
|||
1174 | o> 0\n |
|
|||
1175 |
|
||||
1176 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1177 | > raw |
|
|||
1178 | > upgrade token\n |
|
|||
1179 | > readline |
|
|||
1180 | > EOF |
|
|||
1181 | using raw connection to peer |
|
|||
1182 | i> write(14) -> 14: |
|
|||
1183 | i> upgrade token\n |
|
|||
1184 | o> readline() -> 2: |
|
|||
1185 | o> 0\n |
|
|||
1186 |
|
||||
1187 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1188 | > raw |
|
|||
1189 | > upgrade token foo=bar extra-token\n |
|
|||
1190 | > readline |
|
|||
1191 | > EOF |
|
|||
1192 | using raw connection to peer |
|
|||
1193 | i> write(34) -> 34: |
|
|||
1194 | i> upgrade token foo=bar extra-token\n |
|
|||
1195 | o> readline() -> 2: |
|
|||
1196 | o> 0\n |
|
|||
1197 |
|
||||
1198 | Upgrade request to unsupported protocol is ignored |
|
|||
1199 |
|
||||
1200 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1201 | > raw |
|
|||
1202 | > upgrade this-is-some-token proto=unknown1,unknown2\n |
|
|||
1203 | > readline |
|
|||
1204 | > raw |
|
|||
1205 | > hello\n |
|
|||
1206 | > readline |
|
|||
1207 | > readline |
|
|||
1208 | > raw |
|
|||
1209 | > between\n |
|
|||
1210 | > pairs 81\n |
|
|||
1211 | > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1212 | > readline |
|
|||
1213 | > readline |
|
|||
1214 | > EOF |
|
|||
1215 | using raw connection to peer |
|
|||
1216 | i> write(51) -> 51: |
|
|||
1217 | i> upgrade this-is-some-token proto=unknown1,unknown2\n |
|
|||
1218 | o> readline() -> 2: |
|
|||
1219 | o> 0\n |
|
|||
1220 | i> write(6) -> 6: |
|
|||
1221 | i> hello\n |
|
|||
1222 | o> readline() -> 4: |
|
|||
1223 | o> 444\n |
|
|||
1224 | o> readline() -> 444: |
|
|||
1225 | o> capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\n |
|
|||
1226 | i> write(98) -> 98: |
|
|||
1227 | i> between\n |
|
|||
1228 | i> pairs 81\n |
|
|||
1229 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1230 | o> readline() -> 2: |
|
|||
1231 | o> 1\n |
|
|||
1232 | o> readline() -> 1: |
|
|||
1233 | o> \n |
|
|||
1234 |
|
||||
1235 | Upgrade request must be followed by hello + between |
|
|||
1236 |
|
||||
1237 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1238 | > raw |
|
|||
1239 | > upgrade token proto=exp-ssh-v2-0003\n |
|
|||
1240 | > invalid\n |
|
|||
1241 | > readline |
|
|||
1242 | > readavailable |
|
|||
1243 | > EOF |
|
|||
1244 | using raw connection to peer |
|
|||
1245 | i> write(44) -> 44: |
|
|||
1246 | i> upgrade token proto=exp-ssh-v2-0003\n |
|
|||
1247 | i> invalid\n |
|
|||
1248 | o> readline() -> 1: |
|
|||
1249 | o> \n |
|
|||
1250 | e> read(-1) -> 46: |
|
|||
1251 | e> malformed handshake protocol: missing hello\n |
|
|||
1252 | e> -\n |
|
|||
1253 |
|
||||
1254 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1255 | > raw |
|
|||
1256 | > upgrade token proto=exp-ssh-v2-0003\n |
|
|||
1257 | > hello\n |
|
|||
1258 | > invalid\n |
|
|||
1259 | > readline |
|
|||
1260 | > readavailable |
|
|||
1261 | > EOF |
|
|||
1262 | using raw connection to peer |
|
|||
1263 | i> write(50) -> 50: |
|
|||
1264 | i> upgrade token proto=exp-ssh-v2-0003\n |
|
|||
1265 | i> hello\n |
|
|||
1266 | i> invalid\n |
|
|||
1267 | o> readline() -> 1: |
|
|||
1268 | o> \n |
|
|||
1269 | e> read(-1) -> 48: |
|
|||
1270 | e> malformed handshake protocol: missing between\n |
|
|||
1271 | e> -\n |
|
|||
1272 |
|
||||
1273 | $ hg debugwireproto --localssh --peer raw << EOF |
|
|||
1274 | > raw |
|
|||
1275 | > upgrade token proto=exp-ssh-v2-0003\n |
|
|||
1276 | > hello\n |
|
|||
1277 | > between\n |
|
|||
1278 | > invalid\n |
|
|||
1279 | > readline |
|
|||
1280 | > readavailable |
|
|||
1281 | > EOF |
|
|||
1282 | using raw connection to peer |
|
|||
1283 | i> write(58) -> 58: |
|
|||
1284 | i> upgrade token proto=exp-ssh-v2-0003\n |
|
|||
1285 | i> hello\n |
|
|||
1286 | i> between\n |
|
|||
1287 | i> invalid\n |
|
|||
1288 | o> readline() -> 1: |
|
|||
1289 | o> \n |
|
|||
1290 | e> read(-1) -> 49: |
|
|||
1291 | e> malformed handshake protocol: missing pairs 81\n |
|
|||
1292 | e> -\n |
|
|||
1293 |
|
||||
1294 | Legacy commands are not exposed to version 2 of protocol |
|
|||
1295 |
|
||||
1296 | TODO re-enable these once we're back to actually using v2 commands |
|
|||
1297 |
|
||||
1298 | $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF |
|
|||
1299 | > command branches |
|
|||
1300 | > nodes 0000000000000000000000000000000000000000 |
|
|||
1301 | > EOF |
|
|||
1302 | creating ssh peer from handshake results |
|
|||
1303 | sending branches command |
|
|||
1304 | response: |
|
|||
1305 |
|
||||
1306 | $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF |
|
|||
1307 | > command changegroup |
|
|||
1308 | > roots 0000000000000000000000000000000000000000 |
|
|||
1309 | > EOF |
|
|||
1310 | creating ssh peer from handshake results |
|
|||
1311 | sending changegroup command |
|
|||
1312 | response: |
|
|||
1313 |
|
||||
1314 | $ hg --config experimental.sshpeer.advertise-v2=true debugwireproto --localssh << EOF |
|
|||
1315 | > command changegroupsubset |
|
|||
1316 | > bases 0000000000000000000000000000000000000000 |
|
|||
1317 | > heads 0000000000000000000000000000000000000000 |
|
|||
1318 | > EOF |
|
|||
1319 | creating ssh peer from handshake results |
|
|||
1320 | sending changegroupsubset command |
|
|||
1321 | response: |
|
|||
1322 |
|
||||
1323 | $ cd .. |
|
906 | $ cd .. | |
1324 |
|
907 | |||
1325 | Test listkeys for listing namespaces |
|
908 | Test listkeys for listing namespaces | |
@@ -1364,41 +947,6 b' Test listkeys for listing namespaces' | |||||
1364 | b'namespaces': b'', |
|
947 | b'namespaces': b'', | |
1365 | b'phases': b'' |
|
948 | b'phases': b'' | |
1366 | } |
|
949 | } | |
1367 |
|
||||
1368 | testing ssh2 |
|
|||
1369 | creating ssh peer from handshake results |
|
|||
1370 | i> write(171) -> 171: |
|
|||
1371 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1372 | i> hello\n |
|
|||
1373 | i> between\n |
|
|||
1374 | i> pairs 81\n |
|
|||
1375 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1376 | i> flush() -> None |
|
|||
1377 | o> readline() -> 62: |
|
|||
1378 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1379 | o> readline() -> 4: |
|
|||
1380 | o> 443\n |
|
|||
1381 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1382 | o> read(1) -> 1: |
|
|||
1383 | o> \n |
|
|||
1384 | sending listkeys command |
|
|||
1385 | i> write(9) -> 9: |
|
|||
1386 | i> listkeys\n |
|
|||
1387 | i> write(13) -> 13: |
|
|||
1388 | i> namespace 10\n |
|
|||
1389 | i> write(10) -> 10: namespaces |
|
|||
1390 | i> flush() -> None |
|
|||
1391 | o> bufferedreadline() -> 3: |
|
|||
1392 | o> 30\n |
|
|||
1393 | o> bufferedread(30) -> 30: |
|
|||
1394 | o> bookmarks\t\n |
|
|||
1395 | o> namespaces\t\n |
|
|||
1396 | o> phases\t |
|
|||
1397 | response: { |
|
|||
1398 | b'bookmarks': b'', |
|
|||
1399 | b'namespaces': b'', |
|
|||
1400 | b'phases': b'' |
|
|||
1401 | } |
|
|||
1402 |
|
950 | |||
1403 | $ cd .. |
|
951 | $ cd .. | |
1404 |
|
952 | |||
@@ -1444,33 +992,6 b' With no bookmarks set' | |||||
1444 | o> bufferedreadline() -> 2: |
|
992 | o> bufferedreadline() -> 2: | |
1445 | o> 0\n |
|
993 | o> 0\n | |
1446 | response: {} |
|
994 | response: {} | |
1447 |
|
||||
1448 | testing ssh2 |
|
|||
1449 | creating ssh peer from handshake results |
|
|||
1450 | i> write(171) -> 171: |
|
|||
1451 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1452 | i> hello\n |
|
|||
1453 | i> between\n |
|
|||
1454 | i> pairs 81\n |
|
|||
1455 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1456 | i> flush() -> None |
|
|||
1457 | o> readline() -> 62: |
|
|||
1458 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1459 | o> readline() -> 4: |
|
|||
1460 | o> 443\n |
|
|||
1461 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1462 | o> read(1) -> 1: |
|
|||
1463 | o> \n |
|
|||
1464 | sending listkeys command |
|
|||
1465 | i> write(9) -> 9: |
|
|||
1466 | i> listkeys\n |
|
|||
1467 | i> write(12) -> 12: |
|
|||
1468 | i> namespace 9\n |
|
|||
1469 | i> write(9) -> 9: bookmarks |
|
|||
1470 | i> flush() -> None |
|
|||
1471 | o> bufferedreadline() -> 2: |
|
|||
1472 | o> 0\n |
|
|||
1473 | response: {} |
|
|||
1474 |
|
995 | |||
1475 | With a single bookmark set |
|
996 | With a single bookmark set | |
1476 |
|
997 | |||
@@ -1508,36 +1029,6 b' With a single bookmark set' | |||||
1508 | response: { |
|
1029 | response: { | |
1509 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f' |
|
1030 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f' | |
1510 | } |
|
1031 | } | |
1511 |
|
||||
1512 | testing ssh2 |
|
|||
1513 | creating ssh peer from handshake results |
|
|||
1514 | i> write(171) -> 171: |
|
|||
1515 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1516 | i> hello\n |
|
|||
1517 | i> between\n |
|
|||
1518 | i> pairs 81\n |
|
|||
1519 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1520 | i> flush() -> None |
|
|||
1521 | o> readline() -> 62: |
|
|||
1522 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1523 | o> readline() -> 4: |
|
|||
1524 | o> 443\n |
|
|||
1525 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1526 | o> read(1) -> 1: |
|
|||
1527 | o> \n |
|
|||
1528 | sending listkeys command |
|
|||
1529 | i> write(9) -> 9: |
|
|||
1530 | i> listkeys\n |
|
|||
1531 | i> write(12) -> 12: |
|
|||
1532 | i> namespace 9\n |
|
|||
1533 | i> write(9) -> 9: bookmarks |
|
|||
1534 | i> flush() -> None |
|
|||
1535 | o> bufferedreadline() -> 3: |
|
|||
1536 | o> 46\n |
|
|||
1537 | o> bufferedread(46) -> 46: bookA\t68986213bd4485ea51533535e3fc9e78007a711f |
|
|||
1538 | response: { |
|
|||
1539 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f' |
|
|||
1540 | } |
|
|||
1541 |
|
1032 | |||
1542 | With multiple bookmarks set |
|
1033 | With multiple bookmarks set | |
1543 |
|
1034 | |||
@@ -1578,39 +1069,6 b' With multiple bookmarks set' | |||||
1578 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f', |
|
1069 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f', | |
1579 | b'bookB': b'1880f3755e2e52e3199e0ee5638128b08642f34d' |
|
1070 | b'bookB': b'1880f3755e2e52e3199e0ee5638128b08642f34d' | |
1580 | } |
|
1071 | } | |
1581 |
|
||||
1582 | testing ssh2 |
|
|||
1583 | creating ssh peer from handshake results |
|
|||
1584 | i> write(171) -> 171: |
|
|||
1585 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1586 | i> hello\n |
|
|||
1587 | i> between\n |
|
|||
1588 | i> pairs 81\n |
|
|||
1589 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1590 | i> flush() -> None |
|
|||
1591 | o> readline() -> 62: |
|
|||
1592 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1593 | o> readline() -> 4: |
|
|||
1594 | o> 443\n |
|
|||
1595 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1596 | o> read(1) -> 1: |
|
|||
1597 | o> \n |
|
|||
1598 | sending listkeys command |
|
|||
1599 | i> write(9) -> 9: |
|
|||
1600 | i> listkeys\n |
|
|||
1601 | i> write(12) -> 12: |
|
|||
1602 | i> namespace 9\n |
|
|||
1603 | i> write(9) -> 9: bookmarks |
|
|||
1604 | i> flush() -> None |
|
|||
1605 | o> bufferedreadline() -> 3: |
|
|||
1606 | o> 93\n |
|
|||
1607 | o> bufferedread(93) -> 93: |
|
|||
1608 | o> bookA\t68986213bd4485ea51533535e3fc9e78007a711f\n |
|
|||
1609 | o> bookB\t1880f3755e2e52e3199e0ee5638128b08642f34d |
|
|||
1610 | response: { |
|
|||
1611 | b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f', |
|
|||
1612 | b'bookB': b'1880f3755e2e52e3199e0ee5638128b08642f34d' |
|
|||
1613 | } |
|
|||
1614 |
|
1072 | |||
1615 | Test pushkey for bookmarks |
|
1073 | Test pushkey for bookmarks | |
1616 |
|
1074 | |||
@@ -1657,43 +1115,6 b' Test pushkey for bookmarks' | |||||
1657 | o> bufferedread(2) -> 2: |
|
1115 | o> bufferedread(2) -> 2: | |
1658 | o> 1\n |
|
1116 | o> 1\n | |
1659 | response: True |
|
1117 | response: True | |
1660 |
|
||||
1661 | testing ssh2 |
|
|||
1662 | creating ssh peer from handshake results |
|
|||
1663 | i> write(171) -> 171: |
|
|||
1664 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1665 | i> hello\n |
|
|||
1666 | i> between\n |
|
|||
1667 | i> pairs 81\n |
|
|||
1668 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1669 | i> flush() -> None |
|
|||
1670 | o> readline() -> 62: |
|
|||
1671 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1672 | o> readline() -> 4: |
|
|||
1673 | o> 443\n |
|
|||
1674 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1675 | o> read(1) -> 1: |
|
|||
1676 | o> \n |
|
|||
1677 | sending pushkey command |
|
|||
1678 | i> write(8) -> 8: |
|
|||
1679 | i> pushkey\n |
|
|||
1680 | i> write(6) -> 6: |
|
|||
1681 | i> key 6\n |
|
|||
1682 | i> write(6) -> 6: remote |
|
|||
1683 | i> write(12) -> 12: |
|
|||
1684 | i> namespace 9\n |
|
|||
1685 | i> write(9) -> 9: bookmarks |
|
|||
1686 | i> write(7) -> 7: |
|
|||
1687 | i> new 40\n |
|
|||
1688 | i> write(40) -> 40: 68986213bd4485ea51533535e3fc9e78007a711f |
|
|||
1689 | i> write(6) -> 6: |
|
|||
1690 | i> old 0\n |
|
|||
1691 | i> flush() -> None |
|
|||
1692 | o> bufferedreadline() -> 2: |
|
|||
1693 | o> 2\n |
|
|||
1694 | o> bufferedread(2) -> 2: |
|
|||
1695 | o> 1\n |
|
|||
1696 | response: True |
|
|||
1697 |
|
1118 | |||
1698 | $ hg bookmarks |
|
1119 | $ hg bookmarks | |
1699 | bookA 0:68986213bd44 |
|
1120 | bookA 0:68986213bd44 | |
@@ -1742,36 +1163,6 b' Phases on empty repo' | |||||
1742 | response: { |
|
1163 | response: { | |
1743 | b'publishing': b'True' |
|
1164 | b'publishing': b'True' | |
1744 | } |
|
1165 | } | |
1745 |
|
||||
1746 | testing ssh2 |
|
|||
1747 | creating ssh peer from handshake results |
|
|||
1748 | i> write(171) -> 171: |
|
|||
1749 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1750 | i> hello\n |
|
|||
1751 | i> between\n |
|
|||
1752 | i> pairs 81\n |
|
|||
1753 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1754 | i> flush() -> None |
|
|||
1755 | o> readline() -> 62: |
|
|||
1756 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1757 | o> readline() -> 4: |
|
|||
1758 | o> 443\n |
|
|||
1759 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1760 | o> read(1) -> 1: |
|
|||
1761 | o> \n |
|
|||
1762 | sending listkeys command |
|
|||
1763 | i> write(9) -> 9: |
|
|||
1764 | i> listkeys\n |
|
|||
1765 | i> write(12) -> 12: |
|
|||
1766 | i> namespace 6\n |
|
|||
1767 | i> write(6) -> 6: phases |
|
|||
1768 | i> flush() -> None |
|
|||
1769 | o> bufferedreadline() -> 3: |
|
|||
1770 | o> 15\n |
|
|||
1771 | o> bufferedread(15) -> 15: publishing\tTrue |
|
|||
1772 | response: { |
|
|||
1773 | b'publishing': b'True' |
|
|||
1774 | } |
|
|||
1775 |
|
1166 | |||
1776 | Create some commits |
|
1167 | Create some commits | |
1777 |
|
1168 | |||
@@ -1830,41 +1221,6 b' Two draft heads' | |||||
1830 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', |
|
1221 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', | |
1831 | b'publishing': b'True' |
|
1222 | b'publishing': b'True' | |
1832 | } |
|
1223 | } | |
1833 |
|
||||
1834 | testing ssh2 |
|
|||
1835 | creating ssh peer from handshake results |
|
|||
1836 | i> write(171) -> 171: |
|
|||
1837 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1838 | i> hello\n |
|
|||
1839 | i> between\n |
|
|||
1840 | i> pairs 81\n |
|
|||
1841 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1842 | i> flush() -> None |
|
|||
1843 | o> readline() -> 62: |
|
|||
1844 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1845 | o> readline() -> 4: |
|
|||
1846 | o> 443\n |
|
|||
1847 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1848 | o> read(1) -> 1: |
|
|||
1849 | o> \n |
|
|||
1850 | sending listkeys command |
|
|||
1851 | i> write(9) -> 9: |
|
|||
1852 | i> listkeys\n |
|
|||
1853 | i> write(12) -> 12: |
|
|||
1854 | i> namespace 6\n |
|
|||
1855 | i> write(6) -> 6: phases |
|
|||
1856 | i> flush() -> None |
|
|||
1857 | o> bufferedreadline() -> 4: |
|
|||
1858 | o> 101\n |
|
|||
1859 | o> bufferedread(101) -> 101: |
|
|||
1860 | o> 20b8a89289d80036e6c4e87c2083e3bea1586637\t1\n |
|
|||
1861 | o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n |
|
|||
1862 | o> publishing\tTrue |
|
|||
1863 | response: { |
|
|||
1864 | b'20b8a89289d80036e6c4e87c2083e3bea1586637': b'1', |
|
|||
1865 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', |
|
|||
1866 | b'publishing': b'True' |
|
|||
1867 | } |
|
|||
1868 |
|
1224 | |||
1869 | Single draft head |
|
1225 | Single draft head | |
1870 |
|
1226 | |||
@@ -1905,39 +1261,6 b' Single draft head' | |||||
1905 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', |
|
1261 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', | |
1906 | b'publishing': b'True' |
|
1262 | b'publishing': b'True' | |
1907 | } |
|
1263 | } | |
1908 |
|
||||
1909 | testing ssh2 |
|
|||
1910 | creating ssh peer from handshake results |
|
|||
1911 | i> write(171) -> 171: |
|
|||
1912 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1913 | i> hello\n |
|
|||
1914 | i> between\n |
|
|||
1915 | i> pairs 81\n |
|
|||
1916 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1917 | i> flush() -> None |
|
|||
1918 | o> readline() -> 62: |
|
|||
1919 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1920 | o> readline() -> 4: |
|
|||
1921 | o> 443\n |
|
|||
1922 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1923 | o> read(1) -> 1: |
|
|||
1924 | o> \n |
|
|||
1925 | sending listkeys command |
|
|||
1926 | i> write(9) -> 9: |
|
|||
1927 | i> listkeys\n |
|
|||
1928 | i> write(12) -> 12: |
|
|||
1929 | i> namespace 6\n |
|
|||
1930 | i> write(6) -> 6: phases |
|
|||
1931 | i> flush() -> None |
|
|||
1932 | o> bufferedreadline() -> 3: |
|
|||
1933 | o> 58\n |
|
|||
1934 | o> bufferedread(58) -> 58: |
|
|||
1935 | o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n |
|
|||
1936 | o> publishing\tTrue |
|
|||
1937 | response: { |
|
|||
1938 | b'c4750011d906c18ea2f0527419cbc1a544435150': b'1', |
|
|||
1939 | b'publishing': b'True' |
|
|||
1940 | } |
|
|||
1941 |
|
1264 | |||
1942 | All public heads |
|
1265 | All public heads | |
1943 |
|
1266 | |||
@@ -1975,36 +1298,6 b' All public heads' | |||||
1975 | response: { |
|
1298 | response: { | |
1976 | b'publishing': b'True' |
|
1299 | b'publishing': b'True' | |
1977 | } |
|
1300 | } | |
1978 |
|
||||
1979 | testing ssh2 |
|
|||
1980 | creating ssh peer from handshake results |
|
|||
1981 | i> write(171) -> 171: |
|
|||
1982 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
1983 | i> hello\n |
|
|||
1984 | i> between\n |
|
|||
1985 | i> pairs 81\n |
|
|||
1986 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
1987 | i> flush() -> None |
|
|||
1988 | o> readline() -> 62: |
|
|||
1989 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
1990 | o> readline() -> 4: |
|
|||
1991 | o> 443\n |
|
|||
1992 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
1993 | o> read(1) -> 1: |
|
|||
1994 | o> \n |
|
|||
1995 | sending listkeys command |
|
|||
1996 | i> write(9) -> 9: |
|
|||
1997 | i> listkeys\n |
|
|||
1998 | i> write(12) -> 12: |
|
|||
1999 | i> namespace 6\n |
|
|||
2000 | i> write(6) -> 6: phases |
|
|||
2001 | i> flush() -> None |
|
|||
2002 | o> bufferedreadline() -> 3: |
|
|||
2003 | o> 15\n |
|
|||
2004 | o> bufferedread(15) -> 15: publishing\tTrue |
|
|||
2005 | response: { |
|
|||
2006 | b'publishing': b'True' |
|
|||
2007 | } |
|
|||
2008 |
|
1301 | |||
2009 | Setting public phase via pushkey |
|
1302 | Setting public phase via pushkey | |
2010 |
|
1303 | |||
@@ -2054,44 +1347,6 b' Setting public phase via pushkey' | |||||
2054 | o> bufferedread(2) -> 2: |
|
1347 | o> bufferedread(2) -> 2: | |
2055 | o> 1\n |
|
1348 | o> 1\n | |
2056 | response: True |
|
1349 | response: True | |
2057 |
|
||||
2058 | testing ssh2 |
|
|||
2059 | creating ssh peer from handshake results |
|
|||
2060 | i> write(171) -> 171: |
|
|||
2061 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
2062 | i> hello\n |
|
|||
2063 | i> between\n |
|
|||
2064 | i> pairs 81\n |
|
|||
2065 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
2066 | i> flush() -> None |
|
|||
2067 | o> readline() -> 62: |
|
|||
2068 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
2069 | o> readline() -> 4: |
|
|||
2070 | o> 443\n |
|
|||
2071 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
2072 | o> read(1) -> 1: |
|
|||
2073 | o> \n |
|
|||
2074 | sending pushkey command |
|
|||
2075 | i> write(8) -> 8: |
|
|||
2076 | i> pushkey\n |
|
|||
2077 | i> write(7) -> 7: |
|
|||
2078 | i> key 40\n |
|
|||
2079 | i> write(40) -> 40: 7127240a084fd9dc86fe8d1f98e26229161ec82b |
|
|||
2080 | i> write(12) -> 12: |
|
|||
2081 | i> namespace 6\n |
|
|||
2082 | i> write(6) -> 6: phases |
|
|||
2083 | i> write(6) -> 6: |
|
|||
2084 | i> new 1\n |
|
|||
2085 | i> write(1) -> 1: 0 |
|
|||
2086 | i> write(6) -> 6: |
|
|||
2087 | i> old 1\n |
|
|||
2088 | i> write(1) -> 1: 1 |
|
|||
2089 | i> flush() -> None |
|
|||
2090 | o> bufferedreadline() -> 2: |
|
|||
2091 | o> 2\n |
|
|||
2092 | o> bufferedread(2) -> 2: |
|
|||
2093 | o> 1\n |
|
|||
2094 | response: True |
|
|||
2095 |
|
1350 | |||
2096 | $ hg phase . |
|
1351 | $ hg phase . | |
2097 | 4: public |
|
1352 | 4: public | |
@@ -2160,40 +1415,3 b' Test batching of requests' | |||||
2160 | response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
1415 | response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n | |
2161 | response #1: bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6 |
|
1416 | response #1: bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6 | |
2162 | response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\npublishing\tTrue |
|
1417 | response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\npublishing\tTrue | |
2163 |
|
||||
2164 | testing ssh2 |
|
|||
2165 | creating ssh peer from handshake results |
|
|||
2166 | i> write(171) -> 171: |
|
|||
2167 | i> upgrade * proto=exp-ssh-v2-0003\n (glob) |
|
|||
2168 | i> hello\n |
|
|||
2169 | i> between\n |
|
|||
2170 | i> pairs 81\n |
|
|||
2171 | i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 |
|
|||
2172 | i> flush() -> None |
|
|||
2173 | o> readline() -> 62: |
|
|||
2174 | o> upgraded * exp-ssh-v2-0003\n (glob) |
|
|||
2175 | o> readline() -> 4: |
|
|||
2176 | o> 443\n |
|
|||
2177 | o> read(443) -> 443: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
|||
2178 | o> read(1) -> 1: |
|
|||
2179 | o> \n |
|
|||
2180 | sending batch with 3 sub-commands |
|
|||
2181 | i> write(6) -> 6: |
|
|||
2182 | i> batch\n |
|
|||
2183 | i> write(4) -> 4: |
|
|||
2184 | i> * 0\n |
|
|||
2185 | i> write(8) -> 8: |
|
|||
2186 | i> cmds 61\n |
|
|||
2187 | i> write(61) -> 61: heads ;listkeys namespace=bookmarks;listkeys namespace=phases |
|
|||
2188 | i> flush() -> None |
|
|||
2189 | o> bufferedreadline() -> 4: |
|
|||
2190 | o> 278\n |
|
|||
2191 | o> bufferedread(278) -> 278: |
|
|||
2192 | o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
|||
2193 | o> ;bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
|||
2194 | o> bookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6;4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\n |
|
|||
2195 | o> bfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\n |
|
|||
2196 | o> publishing\tTrue |
|
|||
2197 | response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n |
|
|||
2198 | response #1: bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6 |
|
|||
2199 | response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\npublishing\tTrue |
|
@@ -1,13 +1,3 b'' | |||||
1 | #testcases sshv1 sshv2 |
|
|||
2 |
|
||||
3 | #if sshv2 |
|
|||
4 | $ cat >> $HGRCPATH << EOF |
|
|||
5 | > [experimental] |
|
|||
6 | > sshpeer.advertise-v2 = true |
|
|||
7 | > sshserver.support-v2 = true |
|
|||
8 | > EOF |
|
|||
9 | #endif |
|
|||
10 |
|
||||
11 | This test tries to exercise the ssh functionality with a dummy script |
|
1 | This test tries to exercise the ssh functionality with a dummy script | |
12 |
|
2 | |||
13 | creating 'remote' repo |
|
3 | creating 'remote' repo | |
@@ -537,17 +527,15 b' debug output' | |||||
537 | $ hg pull --debug ssh://user@dummy/remote --config devel.debug.peer-request=yes |
|
527 | $ hg pull --debug ssh://user@dummy/remote --config devel.debug.peer-request=yes | |
538 | pulling from ssh://user@dummy/remote |
|
528 | pulling from ssh://user@dummy/remote | |
539 | running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re) |
|
529 | running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re) | |
540 | sending upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) |
|
|||
541 | devel-peer-request: hello+between |
|
530 | devel-peer-request: hello+between | |
542 | devel-peer-request: pairs: 81 bytes |
|
531 | devel-peer-request: pairs: 81 bytes | |
543 | sending hello command |
|
532 | sending hello command | |
544 | sending between command |
|
533 | sending between command | |
545 |
remote: 444 ( |
|
534 | remote: 444 (no-rust !) | |
546 |
remote: 463 ( |
|
535 | remote: 463 (rust !) | |
547 | protocol upgraded to exp-ssh-v2-0003 (sshv2 !) |
|
|||
548 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (no-rust !) |
|
536 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (no-rust !) | |
549 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,persistent-nodemap,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (rust !) |
|
537 | remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,persistent-nodemap,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (rust !) | |
550 |
remote: 1 |
|
538 | remote: 1 | |
551 | devel-peer-request: protocaps |
|
539 | devel-peer-request: protocaps | |
552 | devel-peer-request: caps: * bytes (glob) |
|
540 | devel-peer-request: caps: * bytes (glob) | |
553 | sending protocaps command |
|
541 | sending protocaps command |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file | ||
The requested commit or file is too big and content was truncated. Show full diff |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (804 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (576 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (1617 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (743 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (762 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (613 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (1298 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (1475 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (597 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
The requested commit or file is too big and content was truncated. Show full diff |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
The requested commit or file is too big and content was truncated. Show full diff |
General Comments 0
You need to be logged in to leave comments.
Login now