diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a9d9e0ea..6b04b743 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -93,7 +93,6 @@ phutil_register_library_map(array( 'ArcanistHgProxyClient' => 'hgdaemon/ArcanistHgProxyClient.php', 'ArcanistHgProxyServer' => 'hgdaemon/ArcanistHgProxyServer.php', 'ArcanistHgServerChannel' => 'hgdaemon/ArcanistHgServerChannel.php', - 'ArcanistHookAPI' => 'repository/hookapi/ArcanistHookAPI.php', 'ArcanistInstallCertificateWorkflow' => 'workflow/ArcanistInstallCertificateWorkflow.php', 'ArcanistJSHintLinter' => 'lint/linter/ArcanistJSHintLinter.php', 'ArcanistJSHintLinterTestCase' => 'lint/linter/__tests__/ArcanistJSHintLinterTestCase.php', @@ -172,7 +171,6 @@ phutil_register_library_map(array( 'ArcanistStartWorkflow' => 'workflow/ArcanistStartWorkflow.php', 'ArcanistStopWorkflow' => 'workflow/ArcanistStopWorkflow.php', 'ArcanistSubversionAPI' => 'repository/api/ArcanistSubversionAPI.php', - 'ArcanistSubversionHookAPI' => 'repository/hookapi/ArcanistSubversionHookAPI.php', 'ArcanistSummaryLintRenderer' => 'lint/renderer/ArcanistSummaryLintRenderer.php', 'ArcanistTasksWorkflow' => 'workflow/ArcanistTasksWorkflow.php', 'ArcanistTestCase' => 'infrastructure/testing/ArcanistTestCase.php', @@ -353,7 +351,6 @@ phutil_register_library_map(array( 'ArcanistStartWorkflow' => 'ArcanistPhrequentWorkflow', 'ArcanistStopWorkflow' => 'ArcanistPhrequentWorkflow', 'ArcanistSubversionAPI' => 'ArcanistRepositoryAPI', - 'ArcanistSubversionHookAPI' => 'ArcanistHookAPI', 'ArcanistSummaryLintRenderer' => 'ArcanistLintRenderer', 'ArcanistTasksWorkflow' => 'ArcanistWorkflow', 'ArcanistTestCase' => 'ArcanistPhutilTestCase', diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php index 8a4d1212..29cf13d6 100644 --- a/src/lint/engine/ArcanistLintEngine.php +++ b/src/lint/engine/ArcanistLintEngine.php @@ -57,8 +57,6 @@ abstract class ArcanistLintEngine { private $minimumSeverity = ArcanistLintSeverity::SEVERITY_DISABLED; private $changedLines = array(); - private $commitHookMode = false; - private $hookAPI; private $enableAsyncLint = false; private $postponedLinters = array(); @@ -115,20 +113,6 @@ abstract class ArcanistLintEngine { return $this; } - final public function setCommitHookMode($mode) { - $this->commitHookMode = $mode; - return $this; - } - - final public function setHookAPI(ArcanistHookAPI $hook_api) { - $this->hookAPI = $hook_api; - return $this; - } - - final public function getHookAPI() { - return $this->hookAPI; - } - final public function setEnableAsyncLint($enable_async_lint) { $this->enableAsyncLint = $enable_async_lint; return $this; @@ -140,41 +124,20 @@ abstract class ArcanistLintEngine { final public function loadData($path) { if (!isset($this->fileData[$path])) { - if ($this->getCommitHookMode()) { - $this->fileData[$path] = $this->getHookAPI() - ->getCurrentFileData($path); - } else { $disk_path = $this->getFilePathOnDisk($path); $this->fileData[$path] = Filesystem::readFile($disk_path); - } } return $this->fileData[$path]; } public function pathExists($path) { - if ($this->getCommitHookMode()) { - $file_data = $this->loadData($path); - return ($file_data !== null); - } else { - $disk_path = $this->getFilePathOnDisk($path); - return Filesystem::pathExists($disk_path); - } + $disk_path = $this->getFilePathOnDisk($path); + return Filesystem::pathExists($disk_path); } final public function isDirectory($path) { - if ($this->getCommitHookMode()) { - // TODO: This won't get the right result in every case (we need more - // metadata) but should almost always be correct. - try { - $this->loadData($path); - return false; - } catch (Exception $ex) { - return true; - } - } else { - $disk_path = $this->getFilePathOnDisk($path); - return is_dir($disk_path); - } + $disk_path = $this->getFilePathOnDisk($path); + return is_dir($disk_path); } final public function isBinaryFile($path) { @@ -202,10 +165,6 @@ abstract class ArcanistLintEngine { return $this; } - final public function getCommitHookMode() { - return $this->commitHookMode; - } - final public function run() { $linters = $this->buildLinters(); if (!$linters) { @@ -328,9 +287,6 @@ abstract class ArcanistLintEngine { $cache_granularity, $repository_version) { - if ($this->commitHookMode) { - return false; - } switch ($cache_granularity) { case ArcanistLinter::GRANULARITY_FILE: return true; diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php index 23a7f7a6..41e27c1c 100644 --- a/src/lint/linter/ArcanistLinter.php +++ b/src/lint/linter/ArcanistLinter.php @@ -386,11 +386,10 @@ abstract class ArcanistLinter { } final protected function addLintMessage(ArcanistLintMessage $message) { - if (!$this->getEngine()->getCommitHookMode()) { - $root = $this->getEngine()->getWorkingCopy()->getProjectRoot(); - $path = Filesystem::resolvePath($message->getPath(), $root); - $message->setPath(Filesystem::readablePath($path, $root)); - } + $root = $this->getEngine()->getWorkingCopy()->getProjectRoot(); + $path = Filesystem::resolvePath($message->getPath(), $root); + $message->setPath(Filesystem::readablePath($path, $root)); + $this->messages[] = $message; return $message; } diff --git a/src/lint/linter/__tests__/ArcanistLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLinterTestCase.php index 61a50b14..322dca7f 100644 --- a/src/lint/linter/__tests__/ArcanistLinterTestCase.php +++ b/src/lint/linter/__tests__/ArcanistLinterTestCase.php @@ -76,7 +76,6 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase { PhutilTypeSpec::checkMap( $config, array( - 'hook' => 'optional bool', 'config' => 'optional map', 'path' => 'optional string', 'mode' => 'optional string', @@ -114,8 +113,6 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase { $engine->setWorkingCopy($working_copy); $engine->setConfigurationManager($configuration_manager); - $engine->setCommitHookMode(idx($config, 'hook', false)); - $path_name = idx($config, 'path', $path); $engine->setPaths(array($path_name)); diff --git a/src/lint/linter/__tests__/spelling/spell.lint-test b/src/lint/linter/__tests__/spelling/spell.lint-test index a992d1f3..367ba8a5 100644 --- a/src/lint/linter/__tests__/spelling/spell.lint-test +++ b/src/lint/linter/__tests__/spelling/spell.lint-test @@ -18,8 +18,3 @@ warning:7:12 warning:9:15 warning:10:11 warning:11:12 -~~~~~~~~~~ -~~~~~~~~~~ -{ - "hook" : true -} diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php index f5787896..5377ebaf 100644 --- a/src/repository/api/ArcanistGitAPI.php +++ b/src/repository/api/ArcanistGitAPI.php @@ -17,10 +17,6 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI { private $symbolicHeadCommit; private $resolvedHeadCommit; - public static function newHookAPI($root) { - return new ArcanistGitAPI($root); - } - protected function buildLocalFuture(array $argv) { $argv[0] = 'git '.$argv[0]; @@ -704,15 +700,6 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI { return $this; } - public function getPreReceiveHookStatus($old_ref, $new_ref) { - $options = $this->getDiffBaseOptions(); - list($stdout) = $this->execxLocal( - "diff {$options} --raw %s %s --", - $old_ref, - $new_ref); - return $this->parseGitStatus($stdout, $full = true); - } - private function parseGitStatus($status, $full = false) { static $flags = array( 'A' => self::FLAG_ADDED, diff --git a/src/repository/hookapi/ArcanistHookAPI.php b/src/repository/hookapi/ArcanistHookAPI.php deleted file mode 100644 index 2c9a217f..00000000 --- a/src/repository/hookapi/ArcanistHookAPI.php +++ /dev/null @@ -1,9 +0,0 @@ -root = $root; - $this->transaction = $transaction; - $this->repository = $repository; - } - - public function getCurrentFileData($path) { - list($err, $file) = exec_manual( - 'svnlook cat --transaction %s %s %s', - $this->transaction, - $this->repository, - $path); - - return ($err? null : $file); - } - - public function getUpstreamFileData($path) { - list($err, $file) = exec_manual( - 'svnlook cat %s %s', - $this->repository, - $this->root."/$path"); - return ($err ? null : $file); - } - -}