diff --git a/mercurial/help/internals/wireprotocol.txt b/mercurial/help/internals/wireprotocol.txt --- a/mercurial/help/internals/wireprotocol.txt +++ b/mercurial/help/internals/wireprotocol.txt @@ -451,6 +451,10 @@ response. The server terminates if it receives an empty command (a ``\n`` character). +If the server announces support for the ``protocaps`` capability, the client +should issue a ``protocaps`` command after the initial handshake to annonunce +its own capabilities. The client capabilities are persistent. + SSH Version 2 Transport ----------------------- @@ -1121,6 +1125,13 @@ 2006). This capability was introduced at the same time as the ``changegroupsubset`` capability/command. +protocaps +--------- + +Whether the server supports the ``protocaps`` command for SSH V1 transport. + +This capability was introduced in Mercurial 4.6. + pushkey ------- @@ -1530,6 +1541,16 @@ will be present at byte offset N. There is no trailing newline. +protocaps +--------- + +Notify the server about the client capabilities in the SSH V1 transport +protocol. + +The ``caps`` argument is a space-delimited list of capabilities. + +The server will reply with the string ``OK``. + pushkey ------- diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -163,6 +163,17 @@ def _makeconnection(ui, sshcmd, args, re return proc, stdin, stdout, stderr +def _clientcapabilities(): + """Return list of capabilities of this client. + + Returns a list of capabilities that are supported by this client. + """ + protoparams = [] + comps = [e.wireprotosupport().name for e in + util.compengines.supportedwireengines(util.CLIENTROLE)] + protoparams.append('comp=%s' % ','.join(comps)) + return protoparams + def _performhandshake(ui, stdin, stdout, stderr): def badresponse(): # Flush any output on stderr. @@ -609,4 +620,15 @@ def instance(ui, path, create): proc, stdin, stdout, stderr = _makeconnection(ui, sshcmd, args, remotecmd, remotepath, sshenv) - return makepeer(ui, path, proc, stdin, stdout, stderr) + peer = makepeer(ui, path, proc, stdin, stdout, stderr) + + # Finally, if supported by the server, notify it about our own + # capabilities. + if 'protocaps' in peer.capabilities(): + try: + peer._call("protocaps", caps=' '.join(_clientcapabilities())) + except IOError: + peer._cleanup() + raise error.RepoError(_('capability exchange failed')) + + return peer diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -159,6 +159,18 @@ def encodebatchcmds(req): return ';'.join(cmds) +def clientcompressionsupport(proto): + """Returns a list of compression methods supported by the client. + + Returns a list of the compression methods supported by the client + according to the protocol capabilities. If no such capability has + been announced, fallback to the default of zlib and uncompressed. + """ + for cap in proto.getprotocaps(): + if cap.startswith('comp='): + return cap[5:].split(',') + return ['zlib', 'none'] + # mapping of options accepted by getbundle and their types # # Meant to be extended by extensions. It is extensions responsibility to ensure @@ -1027,6 +1039,13 @@ def known(repo, proto, nodes, others): v = ''.join(b and '1' or '0' for b in repo.known(decodelist(nodes))) return wireprototypes.bytesresponse(v) +@wireprotocommand('protocaps', 'caps', permission='pull', + transportpolicy=POLICY_V1_ONLY) +def protocaps(repo, proto, caps): + if proto.name == wireprototypes.SSHV1: + proto._protocaps = set(caps.split(' ')) + return wireprototypes.bytesresponse('OK') + @wireprotocommand('pushkey', 'namespace key old new', permission='push') def pushkey(repo, proto, namespace, key, old, new): # compatibility with pre-1.8 clients which were accidentally diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -67,6 +67,7 @@ class httpv1protocolhandler(object): self._req = req self._ui = ui self._checkperm = checkperm + self._protocaps = None @property def name(self): @@ -99,6 +100,12 @@ class httpv1protocolhandler(object): args.update(urlreq.parseqs(argvalue, keep_blank_values=True)) return args + def getprotocaps(self): + if self._protocaps is None: + value = decodevaluefromheaders(self._req, r'X-HgProto') + self._protocaps = set(value.split(' ')) + return self._protocaps + def forwardpayload(self, fp): # Existing clients *always* send Content-Length. length = int(self._req.headers[b'Content-Length']) @@ -599,6 +606,10 @@ class httpv2protocolhandler(object): return [data[k] for k in args.split()] + def getprotocaps(self): + # Protocol capabilities are currently not implemented for HTTP V2. + return set() + def forwardpayload(self, fp): raise NotImplementedError @@ -615,28 +626,21 @@ class httpv2protocolhandler(object): def checkperm(self, perm): raise NotImplementedError -def _httpresponsetype(ui, req, prefer_uncompressed): +def _httpresponsetype(ui, proto, prefer_uncompressed): """Determine the appropriate response type and compression settings. Returns a tuple of (mediatype, compengine, engineopts). """ # Determine the response media type and compression engine based # on the request parameters. - protocaps = decodevaluefromheaders(req, 'X-HgProto').split(' ') - if '0.2' in protocaps: + if '0.2' in proto.getprotocaps(): # All clients are expected to support uncompressed data. if prefer_uncompressed: return HGTYPE2, util._noopengine(), {} - # Default as defined by wire protocol spec. - compformats = ['zlib', 'none'] - for cap in protocaps: - if cap.startswith('comp='): - compformats = cap[5:].split(',') - break - # Now find an agreed upon compression format. + compformats = wireproto.clientcompressionsupport(proto) for engine in wireproto.supportedcompengines(ui, util.SERVERROLE): if engine.wireprotosupport().name in compformats: opts = {} @@ -705,7 +709,7 @@ def _callhttp(repo, req, res, proto, cmd # This code for compression should not be streamres specific. It # is here because we only compress streamres at the moment. mediatype, engine, engineopts = _httpresponsetype( - repo.ui, req, rsp.prefer_uncompressed) + repo.ui, proto, rsp.prefer_uncompressed) gen = engine.compressstream(gen, engineopts) if mediatype == HGTYPE2: @@ -749,6 +753,7 @@ class sshv1protocolhandler(object): self._ui = ui self._fin = fin self._fout = fout + self._protocaps = set() @property def name(self): @@ -775,6 +780,9 @@ class sshv1protocolhandler(object): data[arg] = val return [data[k] for k in keys] + def getprotocaps(self): + return self._protocaps + def forwardpayload(self, fpout): # We initially send an empty response. This tells the client it is # OK to start sending data. If a client sees any other response, it @@ -800,6 +808,8 @@ class sshv1protocolhandler(object): return 'remote:ssh:' + client def addcapabilities(self, repo, caps): + if self.name == wireprototypes.SSHV1: + caps.append(b'protocaps') caps.append(b'batch') return caps diff --git a/mercurial/wireprototypes.py b/mercurial/wireprototypes.py --- a/mercurial/wireprototypes.py +++ b/mercurial/wireprototypes.py @@ -117,6 +117,12 @@ class baseprotocolhandler(zi.Interface): returns a list of values (same order as )""" + def getprotocaps(): + """Returns the list of protocol-level capabilities of client + + Returns a list of capabilities as declared by the client for + the current request (or connection for stateful protocol handlers).""" + def forwardpayload(fp): """Read the raw payload and forward to a file. diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t --- a/tests/test-debugcommands.t +++ b/tests/test-debugcommands.t @@ -407,9 +407,12 @@ Test debugpeer devel-peer-request: between devel-peer-request: pairs: 81 bytes sending between command - remote: 403 - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: 413 + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch remote: 1 + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command url: ssh://user@dummy/debugrevlog local: no pushable: yes diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t --- a/tests/test-ssh-bundle1.t +++ b/tests/test-ssh-bundle1.t @@ -480,10 +480,11 @@ debug output sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) sending hello command sending between command - remote: 403 (sshv1 !) + remote: 413 (sshv1 !) protocol upgraded to exp-ssh-v2-0001 (sshv2 !) - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch remote: 1 (sshv1 !) + sending protocaps command preparing listkeys for "bookmarks" sending listkeys command received listkey for "bookmarks": 45 bytes diff --git a/tests/test-ssh-proto-unbundle.t b/tests/test-ssh-proto-unbundle.t --- a/tests/test-ssh-proto-unbundle.t +++ b/tests/test-ssh-proto-unbundle.t @@ -56,9 +56,9 @@ Test pushing bundle1 payload to a server i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -110,8 +110,8 @@ Test pushing bundle1 payload to a server o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -225,9 +225,9 @@ ui.write() in hook is redirected to stde i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -285,8 +285,8 @@ ui.write() in hook is redirected to stde o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -353,9 +353,9 @@ And a variation that writes multiple lin i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -414,8 +414,8 @@ And a variation that writes multiple lin o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -483,9 +483,9 @@ And a variation that does a ui.flush() a i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -543,8 +543,8 @@ And a variation that does a ui.flush() a o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -611,9 +611,9 @@ Multiple writes + flush i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -672,8 +672,8 @@ Multiple writes + flush o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -741,9 +741,9 @@ ui.write() + ui.write_err() output is ca i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -804,8 +804,8 @@ ui.write() + ui.write_err() output is ca o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -875,9 +875,9 @@ print() output is captured i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -935,8 +935,8 @@ print() output is captured o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -1003,9 +1003,9 @@ Mixed print() and ui.write() are both ca i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1066,8 +1066,8 @@ Mixed print() and ui.write() are both ca o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -1137,9 +1137,9 @@ print() to stdout and stderr both get ca i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1200,8 +1200,8 @@ print() to stdout and stderr both get ca o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -1277,9 +1277,9 @@ Shell hook writing to stdout has output i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1338,8 +1338,8 @@ Shell hook writing to stdout has output o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -1408,9 +1408,9 @@ Shell hook writing to stderr has output i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1469,8 +1469,8 @@ Shell hook writing to stderr has output o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -1541,9 +1541,9 @@ Shell hook writing to stdout and stderr i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1604,8 +1604,8 @@ Shell hook writing to stdout and stderr o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -1684,9 +1684,9 @@ Shell and Python hooks writing to stdout i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1751,8 +1751,8 @@ Shell and Python hooks writing to stdout o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -1826,9 +1826,9 @@ Pushing a bundle1 with no output i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1882,8 +1882,8 @@ Pushing a bundle1 with no output o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command @@ -1958,9 +1958,9 @@ Pushing a bundle1 with ui.write() and ui i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -2018,8 +2018,8 @@ Pushing a bundle1 with ui.write() and ui o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending unbundle command diff --git a/tests/test-ssh-proto.t b/tests/test-ssh-proto.t --- a/tests/test-ssh-proto.t +++ b/tests/test-ssh-proto.t @@ -63,9 +63,12 @@ Test a normal behaving server, for sanit devel-peer-request: between devel-peer-request: pairs: 81 bytes sending between command - remote: 403 - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: 413 + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch remote: 1 + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command url: ssh://user@dummy/server local: no pushable: yes @@ -82,9 +85,9 @@ Server should answer the "hello" command i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n `hg debugserve --sshstdio` works @@ -92,8 +95,8 @@ Server should answer the "hello" command $ hg debugserve --sshstdio << EOF > hello > EOF - 403 - capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + 413 + capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch I/O logging works @@ -101,24 +104,24 @@ I/O logging works > hello > EOF o> write(4) -> 4: - o> 403\n - o> write(403) -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n - 403 - capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 413\n + o> write(413) -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n + 413 + capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> flush() -> None $ hg debugserve --sshstdio --logiofile $TESTTMP/io << EOF > hello > EOF - 403 - capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + 413 + capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch $ cat $TESTTMP/io o> write(4) -> 4: - o> 403\n - o> write(403) -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> write(413) -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> flush() -> None $ cd .. @@ -143,9 +146,9 @@ reply with empty response to the "betwee i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -182,9 +185,12 @@ SSH banner is not printed by default, ig remote: banner: line 7 remote: banner: line 8 remote: banner: line 9 - remote: 403 - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: 413 + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch remote: 1 + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command url: ssh://user@dummy/server local: no pushable: yes @@ -237,9 +243,9 @@ And test the banner with the raw protoco o> readline() -> 15: o> banner: line 9\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -290,13 +296,13 @@ Sending an unknown command to the server i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n + o> 413\n i> write(98) -> 98: i> between\n i> pairs 81\n i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n @@ -310,9 +316,12 @@ Sending an unknown command to the server devel-peer-request: pairs: 81 bytes sending between command remote: 0 - remote: 403 - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: 413 + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch remote: 1 + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command url: ssh://user@dummy/server local: no pushable: yes @@ -356,9 +365,9 @@ Send multiple unknown commands before he i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -382,9 +391,12 @@ Send multiple unknown commands before he remote: 0 remote: 0 remote: 0 - remote: 403 - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: 413 + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch remote: 1 + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command url: ssh://user@dummy/server local: no pushable: yes @@ -436,9 +448,9 @@ Send an unknown command before hello tha i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -483,9 +495,9 @@ Send an unknown command having an argume i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -528,9 +540,9 @@ Send an unknown command having an argume i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -598,9 +610,9 @@ Dictionary value for unknown command i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n Incomplete dictionary send @@ -680,9 +692,9 @@ Send a command line with spaces i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -714,9 +726,9 @@ Send a command line with spaces i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -757,9 +769,9 @@ Send a command line with spaces i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -786,9 +798,9 @@ Send an unknown command after the "betwe i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(105) -> 105: i> between\n i> pairs 81\n @@ -827,9 +839,9 @@ And one with arguments i> pairs 81\n i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -876,9 +888,9 @@ Send a valid command before the handshak o> readline() -> 41: o> 68986213bd4485ea51533535e3fc9e78007a711f\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n @@ -903,7 +915,7 @@ And a variation that doesn't send the be o> readline() -> 41: o> 68986213bd4485ea51533535e3fc9e78007a711f\n o> readline() -> 4: - o> 403\n + o> 413\n Send an upgrade request to a server that doesn't support that command @@ -932,9 +944,9 @@ Send an upgrade request to a server that i> pairs 81\n i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -952,9 +964,12 @@ Send an upgrade request to a server that devel-peer-request: pairs: 81 bytes sending between command remote: 0 - remote: 403 - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: 413 + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch remote: 1 + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command url: ssh://user@dummy/server local: no pushable: yes @@ -992,9 +1007,9 @@ Send an upgrade request to a server that o> readline() -> 44: o> upgraded this-is-some-token exp-ssh-v2-0001\n o> readline() -> 4: - o> 402\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 412\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n $ cd .. @@ -1008,7 +1023,10 @@ Send an upgrade request to a server that devel-peer-request: pairs: 81 bytes sending between command protocol upgraded to exp-ssh-v2-0001 - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command url: ssh://user@dummy/server local: no pushable: yes @@ -1025,7 +1043,10 @@ Verify the peer has capabilities devel-peer-request: pairs: 81 bytes sending between command protocol upgraded to exp-ssh-v2-0001 - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command Main capabilities: batch branchmap @@ -1034,6 +1055,7 @@ Verify the peer has capabilities getbundle known lookup + protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN @@ -1092,9 +1114,9 @@ Command after upgrade to version 2 is pr o> readline() -> 44: o> upgraded this-is-some-token exp-ssh-v2-0001\n o> readline() -> 4: - o> 402\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 412\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(6) -> 6: i> hello\n o> readline() -> 4: @@ -1130,9 +1152,9 @@ Multiple upgrades is not allowed o> readline() -> 44: o> upgraded this-is-some-token exp-ssh-v2-0001\n o> readline() -> 4: - o> 402\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 412\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(45) -> 45: i> upgrade another-token proto=irrelevant\n i> hello\n @@ -1203,9 +1225,9 @@ Upgrade request to unsupported protocol i> write(6) -> 6: i> hello\n o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n i> write(98) -> 98: i> between\n i> pairs 81\n @@ -1325,9 +1347,9 @@ Test listkeys for listing namespaces i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1359,8 +1381,8 @@ Test listkeys for listing namespaces o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending listkeys command @@ -1405,9 +1427,9 @@ With no bookmarks set i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1435,8 +1457,8 @@ With no bookmarks set o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending listkeys command @@ -1466,9 +1488,9 @@ With a single bookmark set i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1497,8 +1519,8 @@ With a single bookmark set o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending listkeys command @@ -1529,9 +1551,9 @@ With multiple bookmarks set i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1562,8 +1584,8 @@ With multiple bookmarks set o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending listkeys command @@ -1598,9 +1620,9 @@ Test pushkey for bookmarks i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1638,8 +1660,8 @@ Test pushkey for bookmarks o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending pushkey command @@ -1690,9 +1712,9 @@ Phases on empty repo i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1721,8 +1743,8 @@ Phases on empty repo o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending listkeys command @@ -1769,9 +1791,9 @@ Two draft heads i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1803,8 +1825,8 @@ Two draft heads o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending listkeys command @@ -1838,9 +1860,9 @@ Single draft head i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1871,8 +1893,8 @@ Single draft head o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending listkeys command @@ -1905,9 +1927,9 @@ All public heads i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -1936,8 +1958,8 @@ All public heads o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending listkeys command @@ -1972,9 +1994,9 @@ Setting public phase via pushkey i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -2013,8 +2035,8 @@ Setting public phase via pushkey o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending pushkey command @@ -2079,9 +2101,9 @@ Test batching of requests i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 i> flush() -> None o> readline() -> 4: - o> 403\n - o> readline() -> 403: - o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch\n + o> 413\n + o> readline() -> 413: + o> capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch\n o> readline() -> 2: o> 1\n o> readline() -> 1: @@ -2119,8 +2141,8 @@ Test batching of requests o> readline() -> 62: o> upgraded * exp-ssh-v2-0001\n (glob) o> readline() -> 4: - o> 402\n - o> read(402) -> 402: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + o> 412\n + o> read(412) -> 412: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch o> read(1) -> 1: o> \n sending batch with 3 sub-commands diff --git a/tests/test-ssh.t b/tests/test-ssh.t --- a/tests/test-ssh.t +++ b/tests/test-ssh.t @@ -495,10 +495,13 @@ debug output devel-peer-request: between devel-peer-request: pairs: 81 bytes sending between command - remote: 403 (sshv1 !) + remote: 413 (sshv1 !) protocol upgraded to exp-ssh-v2-0001 (sshv2 !) - remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN batch + remote: capabilities: lookup branchmap pushkey known getbundle unbundlehash changegroupsubset streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN protocaps batch remote: 1 (sshv1 !) + devel-peer-request: protocaps + devel-peer-request: caps: * bytes (glob) + sending protocaps command query 1; heads devel-peer-request: batched-content devel-peer-request: - heads (0 arguments)