Changeset View
Changeset View
Standalone View
Standalone View
src/hgdaemon/ArcanistHgServerChannel.php
| Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | /* -( Protocol Implementation )-------------------------------------------- */ | ||||
| * | * | ||||
| * @param list<string> List of command arguments. | * @param list<string> List of command arguments. | ||||
| * @return string Encoded string for transmission to the server. | * @return string Encoded string for transmission to the server. | ||||
| * | * | ||||
| * @task protocol | * @task protocol | ||||
| */ | */ | ||||
| protected function encodeMessage($argv) { | protected function encodeMessage($argv) { | ||||
| if (!is_array($argv)) { | if (!is_array($argv)) { | ||||
| throw new Exception("Message to Mercurial server should be an array."); | throw new Exception('Message to Mercurial server should be an array.'); | ||||
| } | } | ||||
| $command = head($argv); | $command = head($argv); | ||||
| $args = array_slice($argv, 1); | $args = array_slice($argv, 1); | ||||
| $args = implode("\0", $args); | $args = implode("\0", $args); | ||||
| $len = strlen($args); | $len = strlen($args); | ||||
| ▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines | |||||