@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support Mercurial "protocaps" wire command

Summary:
Ref T13187. See PHI834. Mercurial has somewhat-recently (changeset is from Jan 2018) introduced a new "protocaps" command, that appears in Mercurial 4.7 and possibly before then.

We must explicitly enumerate all protocol commands because you can't decode the protocol without knowing how many arguments the command expects, so enumerate it.

(Also fix an issue where the related error message had an extra apostrophe.)

Test Plan:
- Ran `hg clone ...` with client and server on Mercurial 4.7.
- Before: fatal on unknown "protocaps" command.
- Midway: better typography in error message.
- After: clean clone.

Reviewers: amckinley

Maniphest Tasks: T13187

Differential Revision: https://secure.phabricator.com/D19596

+6 -1
+6 -1
src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php
··· 23 23 'listkeys' => array('namespace'), 24 24 'lookup' => array('key'), 25 25 'pushkey' => array('namespace', 'key', 'old', 'new'), 26 + 'protocaps' => array('caps'), 26 27 'stream_out' => array(''), 27 28 'unbundle' => array('heads'), 28 29 ); 29 30 30 31 if (!isset($commands[$command])) { 31 - throw new Exception(pht("Unknown Mercurial command '%s!", $command)); 32 + throw new Exception( 33 + pht( 34 + 'Unknown Mercurial command "%s"!', 35 + $command)); 32 36 } 33 37 34 38 return $commands[$command]; ··· 49 53 'known' => true, 50 54 'listkeys' => true, 51 55 'lookup' => true, 56 + 'protocaps' => true, 52 57 'stream_out' => true, 53 58 ); 54 59