1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-22 21:40:54 +01:00

Support appending arbitrary lines to DisplayRef output

Summary:
Ref T13546. Several substeps in the new "arc land" flow benefit from this. For example:

  - When prompting "land revisions you don't own?", it's used to show authors.
  - When prompting "land revisions in the wrong state?", it's used to show the current states.

Test Plan: Ran future "arc land" workflows, got relevant contextual information via this mechanism.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21308
This commit is contained in:
epriestley 2020-06-04 09:40:43 -07:00
parent fc3974ed70
commit 0e82474007

View file

@ -7,6 +7,7 @@ final class ArcanistDisplayRef
private $ref;
private $uri;
private $lines = array();
public function setRef(ArcanistRef $ref) {
$this->ref = $ref;
@ -26,6 +27,11 @@ final class ArcanistDisplayRef
return $this->uri;
}
public function appendLine($line) {
$this->lines[] = $line;
return $this;
}
public function newTerminalString() {
$ref = $this->getRef();
@ -83,6 +89,10 @@ final class ArcanistDisplayRef
$uri);
}
foreach ($this->lines as $line) {
$output[] = tsprintf(" %s\n", $line);
}
return $output;
}