mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +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:
parent
fc3974ed70
commit
0e82474007
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue