]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Remove the `inlines` workflow
authorJoshua Spence <josh@joshuaspence.com>
Tue, 30 Dec 2014 23:45:41 +0000 (10:45 +1100)
committerJoshua Spence <josh@joshuaspence.com>
Tue, 30 Dec 2014 23:45:41 +0000 (10:45 +1100)
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
src/workflow/ArcanistInlinesWorkflow.php [deleted file]

index aaf92d11462e171ec22c215bbe2a9070245f7bec..4f638963b2335c64ebd8cce543779315264391a6 100644 (file)
@@ -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 (file)
index 88d6d58..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-
-final class ArcanistInlinesWorkflow extends ArcanistWorkflow {
-
-  public function getWorkflowName() {
-    return 'inlines';
-  }
-
-  public function getCommandSynopses() {
-    return phutil_console_format(<<<EOTEXT
-      **inlines** [--revision __revision_id__]
-EOTEXT
-      );
-  }
-
-  public function getCommandHelp() {
-    return phutil_console_format(<<<EOTEXT
-          Display inline comments related to a particular revision.
-EOTEXT
-      );
-  }
-
-  public function getArguments() {
-    return array(
-      'revision' => 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";
-        }
-      }
-    }
-  }
-
-}