Differential D19596 Diff 46852 src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php
| Show All 17 Lines | $commands = array( | ||||
| 'debugwireargs' => array('one two *'), | 'debugwireargs' => array('one two *'), | ||||
| 'getbundle' => array('*'), | 'getbundle' => array('*'), | ||||
| 'heads' => array(), | 'heads' => array(), | ||||
| 'hello' => array(), | 'hello' => array(), | ||||
| 'known' => array('nodes', '*'), | 'known' => array('nodes', '*'), | ||||
| 'listkeys' => array('namespace'), | 'listkeys' => array('namespace'), | ||||
| 'lookup' => array('key'), | 'lookup' => array('key'), | ||||
| 'pushkey' => array('namespace', 'key', 'old', 'new'), | 'pushkey' => array('namespace', 'key', 'old', 'new'), | ||||
| 'protocaps' => array('caps'), | |||||
| 'stream_out' => array(''), | 'stream_out' => array(''), | ||||
| 'unbundle' => array('heads'), | 'unbundle' => array('heads'), | ||||
| ); | ); | ||||
| if (!isset($commands[$command])) { | if (!isset($commands[$command])) { | ||||
| throw new Exception(pht("Unknown Mercurial command '%s!", $command)); | throw new Exception( | ||||
| pht( | |||||
| 'Unknown Mercurial command "%s"!', | |||||
| $command)); | |||||
| } | } | ||||
| return $commands[$command]; | return $commands[$command]; | ||||
| } | } | ||||
| public static function isReadOnlyCommand($command) { | public static function isReadOnlyCommand($command) { | ||||
| $read_only = array( | $read_only = array( | ||||
| 'between' => true, | 'between' => true, | ||||
| 'branchmap' => true, | 'branchmap' => true, | ||||
| 'branches' => true, | 'branches' => true, | ||||
| 'capabilities' => true, | 'capabilities' => true, | ||||
| 'changegroup' => true, | 'changegroup' => true, | ||||
| 'changegroupsubset' => true, | 'changegroupsubset' => true, | ||||
| 'debugwireargs' => true, | 'debugwireargs' => true, | ||||
| 'getbundle' => true, | 'getbundle' => true, | ||||
| 'heads' => true, | 'heads' => true, | ||||
| 'hello' => true, | 'hello' => true, | ||||
| 'known' => true, | 'known' => true, | ||||
| 'listkeys' => true, | 'listkeys' => true, | ||||
| 'lookup' => true, | 'lookup' => true, | ||||
| 'protocaps' => true, | |||||
| 'stream_out' => true, | 'stream_out' => true, | ||||
| ); | ); | ||||
| // Notably, the write commands are "pushkey" and "unbundle". The | // Notably, the write commands are "pushkey" and "unbundle". The | ||||
| // "batch" command is theoretically read only, but we require explicit | // "batch" command is theoretically read only, but we require explicit | ||||
| // analysis of the actual commands. | // analysis of the actual commands. | ||||
| return isset($read_only[$command]); | return isset($read_only[$command]); | ||||
| ▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines | |||||