mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-29 02:02:40 +01:00
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
This commit is contained in:
parent
a3c3d23dd7
commit
f8be9d7737
2 changed files with 0 additions and 105 deletions
|
@ -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',
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue