From f8be9d7737d1435084adfc37aac2ef7618f46441 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Wed, 31 Dec 2014 10:45:41 +1100 Subject: [PATCH] Remove the `inlines` workflow Summary: Ref T5112. The `arc inlines` workflow no longer works because the `differential.getrevisioncomments` API method has been deprecated (see T2222). The command is basically useless right now. Test Plan: N/A Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T5112 Differential Revision: https://secure.phabricator.com/D9464 --- src/__phutil_library_map__.php | 2 - src/workflow/ArcanistInlinesWorkflow.php | 103 ----------------------- 2 files changed, 105 deletions(-) delete mode 100644 src/workflow/ArcanistInlinesWorkflow.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index aaf92d11..4f638963 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -92,7 +92,6 @@ phutil_register_library_map(array( 'ArcanistHgServerChannel' => 'hgdaemon/ArcanistHgServerChannel.php', 'ArcanistHookAPI' => 'repository/hookapi/ArcanistHookAPI.php', 'ArcanistInfrastructureTestCase' => '__tests__/ArcanistInfrastructureTestCase.php', - 'ArcanistInlinesWorkflow' => 'workflow/ArcanistInlinesWorkflow.php', 'ArcanistInstallCertificateWorkflow' => 'workflow/ArcanistInstallCertificateWorkflow.php', 'ArcanistJSHintLinter' => 'lint/linter/ArcanistJSHintLinter.php', 'ArcanistJSHintLinterTestCase' => 'lint/linter/__tests__/ArcanistJSHintLinterTestCase.php', @@ -283,7 +282,6 @@ phutil_register_library_map(array( 'ArcanistHgClientChannel' => 'PhutilProtocolChannel', 'ArcanistHgServerChannel' => 'PhutilProtocolChannel', 'ArcanistInfrastructureTestCase' => 'ArcanistTestCase', - 'ArcanistInlinesWorkflow' => 'ArcanistWorkflow', 'ArcanistInstallCertificateWorkflow' => 'ArcanistWorkflow', 'ArcanistJSHintLinter' => 'ArcanistExternalLinter', 'ArcanistJSHintLinterTestCase' => 'ArcanistArcanistLinterTestCase', diff --git a/src/workflow/ArcanistInlinesWorkflow.php b/src/workflow/ArcanistInlinesWorkflow.php deleted file mode 100644 index 88d6d580..00000000 --- a/src/workflow/ArcanistInlinesWorkflow.php +++ /dev/null @@ -1,103 +0,0 @@ - array( - 'param' => 'revision_id', - 'help' => - 'Display inline comments for a specific revision. If you do not '. - 'specify a revision, arc will look in the commit message at HEAD.', - ), - 'root' => array( - 'param' => 'directory', - 'help' => 'Specify a string printed in front of each path.', - ), - ); - } - - public function requiresConduit() { - return true; - } - - public function requiresAuthentication() { - return true; - } - - public function requiresRepositoryAPI() { - return true; - } - - public function run() { - if ($this->getArgument('revision')) { - $revision_id = $this->normalizeRevisionID($this->getArgument('revision')); - } else { - $revisions = $this->getRepositoryAPI() - ->loadWorkingCopyDifferentialRevisions($this->getConduit(), array()); - $revision_id = head(ipull($revisions, 'id')); - } - - if (!$revision_id) { - throw new ArcanistUsageException('No revisions found.'); - } - - $comments = array_mergev( - $this->getConduit()->callMethodSynchronous( - 'differential.getrevisioncomments', - array( - 'ids' => array($revision_id), - 'inlines' => true, - ))); - - $authors = array(); - if ($comments) { - $authors = $this->getConduit()->callMethodSynchronous( - 'user.query', - array( - 'phids' => array_unique(ipull($comments, 'authorPHID')), - )); - $authors = ipull($authors, 'userName', 'phid'); - } - - $inlines = array(); - foreach ($comments as $comment) { - $author = idx($authors, $comment['authorPHID']); - foreach ($comment['inlines'] as $inline) { - $file = $inline['filePath']; - $line = $inline['lineNumber']; - $inlines[$file][$line][] = "({$author}) {$inline['content']}"; - } - } - - $root = $this->getArgument('root'); - ksort($inlines); - foreach ($inlines as $file => $file_inlines) { - ksort($file_inlines); - foreach ($file_inlines as $line => $line_inlines) { - foreach ($line_inlines as $content) { - echo "{$root}{$file}:{$line}:{$content}\n"; - } - } - } - } - -}