mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-21 22:32:41 +01:00
Update "arc land" display of build failures, and rename "DisplayRef" to "RefView"
Summary: Ref T13546. Show ongoing and failed builds more clearly in "arc land" output. Also rename "DisplayRef" (which is not a "Ref") to "RefView" with the goal of improving clarity, and let callers "build...()" it so they can add more status, etc., information. Get rid of "[DisplayRef|RefView]Interface". In theory, future refs (say, in Phabricator) might not do anything here, but every Ref just ends up implementing it. This could perhaps be subclassed more narrowly in the future if necessary. Test Plan: Ran "arc land", grepped for various symbols. Maniphest Tasks: T13546 Differential Revision: https://secure.phabricator.com/D21352
This commit is contained in:
parent
33dfa859d8
commit
63f2e667b9
19 changed files with 172 additions and 195 deletions
|
@ -168,8 +168,6 @@ phutil_register_library_map(array(
|
|||
'ArcanistDifferentialDependencyGraph' => 'differential/ArcanistDifferentialDependencyGraph.php',
|
||||
'ArcanistDifferentialRevisionHash' => 'differential/constants/ArcanistDifferentialRevisionHash.php',
|
||||
'ArcanistDifferentialRevisionStatus' => 'differential/constants/ArcanistDifferentialRevisionStatus.php',
|
||||
'ArcanistDisplayRef' => 'ref/ArcanistDisplayRef.php',
|
||||
'ArcanistDisplayRefInterface' => 'ref/ArcanistDisplayRefInterface.php',
|
||||
'ArcanistDoubleQuoteXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistDoubleQuoteXHPASTLinterRule.php',
|
||||
'ArcanistDoubleQuoteXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistDoubleQuoteXHPASTLinterRuleTestCase.php',
|
||||
'ArcanistDownloadWorkflow' => 'workflow/ArcanistDownloadWorkflow.php',
|
||||
|
@ -415,6 +413,7 @@ phutil_register_library_map(array(
|
|||
'ArcanistRaggedClassTreeEdgeXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistRaggedClassTreeEdgeXHPASTLinterRuleTestCase.php',
|
||||
'ArcanistRef' => 'ref/ArcanistRef.php',
|
||||
'ArcanistRefInspector' => 'inspector/ArcanistRefInspector.php',
|
||||
'ArcanistRefView' => 'ref/ArcanistRefView.php',
|
||||
'ArcanistRemoteRef' => 'repository/remote/ArcanistRemoteRef.php',
|
||||
'ArcanistRepositoryAPI' => 'repository/api/ArcanistRepositoryAPI.php',
|
||||
'ArcanistRepositoryAPIMiscTestCase' => 'repository/api/__tests__/ArcanistRepositoryAPIMiscTestCase.php',
|
||||
|
@ -1084,21 +1083,12 @@ phutil_register_library_map(array(
|
|||
'ArcanistBrowseURIRef' => 'ArcanistRef',
|
||||
'ArcanistBrowseWorkflow' => 'ArcanistArcWorkflow',
|
||||
'ArcanistBuildBuildplanHardpointQuery' => 'ArcanistRuntimeHardpointQuery',
|
||||
'ArcanistBuildPlanRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistBuildPlanRef' => 'ArcanistRef',
|
||||
'ArcanistBuildPlanSymbolRef' => 'ArcanistSimpleSymbolRef',
|
||||
'ArcanistBuildRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistBuildRef' => 'ArcanistRef',
|
||||
'ArcanistBuildSymbolRef' => 'ArcanistSimpleSymbolRef',
|
||||
'ArcanistBuildableBuildsHardpointQuery' => 'ArcanistRuntimeHardpointQuery',
|
||||
'ArcanistBuildableRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistBuildableRef' => 'ArcanistRef',
|
||||
'ArcanistBuildableSymbolRef' => 'ArcanistSimpleSymbolRef',
|
||||
'ArcanistBundle' => 'Phobject',
|
||||
'ArcanistBundleTestCase' => 'PhutilTestCase',
|
||||
|
@ -1196,10 +1186,6 @@ phutil_register_library_map(array(
|
|||
'ArcanistDifferentialDependencyGraph' => 'AbstractDirectedGraph',
|
||||
'ArcanistDifferentialRevisionHash' => 'Phobject',
|
||||
'ArcanistDifferentialRevisionStatus' => 'Phobject',
|
||||
'ArcanistDisplayRef' => array(
|
||||
'Phobject',
|
||||
'ArcanistTerminalStringInterface',
|
||||
),
|
||||
'ArcanistDoubleQuoteXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||
'ArcanistDoubleQuoteXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||
'ArcanistDownloadWorkflow' => 'ArcanistArcWorkflow',
|
||||
|
@ -1224,10 +1210,7 @@ phutil_register_library_map(array(
|
|||
'ArcanistExtractUseXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||
'ArcanistFileConfigurationSource' => 'ArcanistFilesystemConfigurationSource',
|
||||
'ArcanistFileDataRef' => 'Phobject',
|
||||
'ArcanistFileRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistFileRef' => 'ArcanistRef',
|
||||
'ArcanistFileSymbolRef' => 'ArcanistSimpleSymbolRef',
|
||||
'ArcanistFileUploader' => 'Phobject',
|
||||
'ArcanistFilenameLinter' => 'ArcanistLinter',
|
||||
|
@ -1357,10 +1340,7 @@ phutil_register_library_map(array(
|
|||
'ArcanistLogicalOperatorsXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||
'ArcanistLowercaseFunctionsXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||
'ArcanistLowercaseFunctionsXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||
'ArcanistMarkerRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistMarkerRef' => 'ArcanistRef',
|
||||
'ArcanistMarkersWorkflow' => 'ArcanistArcWorkflow',
|
||||
'ArcanistMercurialAPI' => 'ArcanistRepositoryAPI',
|
||||
'ArcanistMercurialCommitMessageHardpointQuery' => 'ArcanistWorkflowMercurialHardpointQuery',
|
||||
|
@ -1420,10 +1400,7 @@ phutil_register_library_map(array(
|
|||
'ArcanistParenthesesSpacingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||
'ArcanistParseStrUseXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||
'ArcanistParseStrUseXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||
'ArcanistPasteRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistPasteRef' => 'ArcanistRef',
|
||||
'ArcanistPasteSymbolRef' => 'ArcanistSimpleSymbolRef',
|
||||
'ArcanistPasteWorkflow' => 'ArcanistArcWorkflow',
|
||||
'ArcanistPatchWorkflow' => 'ArcanistWorkflow',
|
||||
|
@ -1454,6 +1431,10 @@ phutil_register_library_map(array(
|
|||
'ArcanistRaggedClassTreeEdgeXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||
'ArcanistRef' => 'ArcanistHardpointObject',
|
||||
'ArcanistRefInspector' => 'Phobject',
|
||||
'ArcanistRefView' => array(
|
||||
'Phobject',
|
||||
'ArcanistTerminalStringInterface',
|
||||
),
|
||||
'ArcanistRemoteRef' => 'ArcanistRef',
|
||||
'ArcanistRepositoryAPI' => 'Phobject',
|
||||
'ArcanistRepositoryAPIMiscTestCase' => 'PhutilTestCase',
|
||||
|
@ -1473,10 +1454,7 @@ phutil_register_library_map(array(
|
|||
'ArcanistRevisionBuildableHardpointQuery' => 'ArcanistRuntimeHardpointQuery',
|
||||
'ArcanistRevisionCommitMessageHardpointQuery' => 'ArcanistRuntimeHardpointQuery',
|
||||
'ArcanistRevisionParentRevisionsHardpointQuery' => 'ArcanistRuntimeHardpointQuery',
|
||||
'ArcanistRevisionRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistRevisionRef' => 'ArcanistRef',
|
||||
'ArcanistRevisionRefSource' => 'Phobject',
|
||||
'ArcanistRevisionSymbolRef' => 'ArcanistSimpleSymbolRef',
|
||||
'ArcanistRuboCopLinter' => 'ArcanistExternalLinter',
|
||||
|
@ -1517,10 +1495,7 @@ phutil_register_library_map(array(
|
|||
'ArcanistSymbolRef' => 'ArcanistRef',
|
||||
'ArcanistSyntaxErrorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||
'ArcanistSystemConfigurationSource' => 'ArcanistFilesystemConfigurationSource',
|
||||
'ArcanistTaskRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistTaskRef' => 'ArcanistRef',
|
||||
'ArcanistTaskSymbolRef' => 'ArcanistSimpleSymbolRef',
|
||||
'ArcanistTasksWorkflow' => 'ArcanistWorkflow',
|
||||
'ArcanistTautologicalExpressionXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||
|
@ -1570,10 +1545,7 @@ phutil_register_library_map(array(
|
|||
'ArcanistUselessOverridingMethodXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||
'ArcanistUserAbortException' => 'ArcanistUsageException',
|
||||
'ArcanistUserConfigurationSource' => 'ArcanistFilesystemConfigurationSource',
|
||||
'ArcanistUserRef' => array(
|
||||
'ArcanistRef',
|
||||
'ArcanistDisplayRefInterface',
|
||||
),
|
||||
'ArcanistUserRef' => 'ArcanistRef',
|
||||
'ArcanistUserSymbolHardpointQuery' => 'ArcanistRuntimeHardpointQuery',
|
||||
'ArcanistUserSymbolRef' => 'ArcanistSymbolRef',
|
||||
'ArcanistUserSymbolRefInspector' => 'ArcanistRefInspector',
|
||||
|
|
|
@ -305,7 +305,7 @@ abstract class ArcanistLandEngine
|
|||
$viewer->getMonogram()));
|
||||
|
||||
foreach ($unauthored as $revision_ref) {
|
||||
$display_ref = $revision_ref->newDisplayRef();
|
||||
$display_ref = $revision_ref->newRefView();
|
||||
|
||||
$author_ref = $revision_ref->getAuthorRef();
|
||||
if ($author_ref) {
|
||||
|
@ -373,7 +373,7 @@ abstract class ArcanistLandEngine
|
|||
phutil_count($planned)));
|
||||
|
||||
foreach ($planned as $revision_ref) {
|
||||
echo tsprintf('%s', $revision_ref->newDisplayRef());
|
||||
echo tsprintf('%s', $revision_ref->newRefView());
|
||||
}
|
||||
|
||||
$query = pht(
|
||||
|
@ -402,7 +402,7 @@ abstract class ArcanistLandEngine
|
|||
$example_ref->getStatusDisplayName()));
|
||||
|
||||
foreach ($published as $revision_ref) {
|
||||
echo tsprintf('%s', $revision_ref->newDisplayRef());
|
||||
echo tsprintf('%s', $revision_ref->newRefView());
|
||||
}
|
||||
|
||||
$query = pht(
|
||||
|
@ -429,7 +429,7 @@ abstract class ArcanistLandEngine
|
|||
phutil_count($not_accepted)));
|
||||
|
||||
foreach ($not_accepted as $revision_ref) {
|
||||
$display_ref = $revision_ref->newDisplayRef();
|
||||
$display_ref = $revision_ref->newRefView();
|
||||
$display_ref->appendLine(
|
||||
pht(
|
||||
'Status: %s',
|
||||
|
@ -493,7 +493,7 @@ abstract class ArcanistLandEngine
|
|||
foreach ($open_parents as $parent_phid => $spec) {
|
||||
$parent_ref = $spec['ref'];
|
||||
|
||||
$display_ref = $parent_ref->newDisplayRef();
|
||||
$display_ref = $parent_ref->newRefView();
|
||||
|
||||
$display_ref->appendLine(
|
||||
pht(
|
||||
|
@ -686,38 +686,31 @@ abstract class ArcanistLandEngine
|
|||
$prompt_key = 'arc.land.ongoing-builds';
|
||||
}
|
||||
|
||||
$workflow = $this->getWorkflow();
|
||||
|
||||
echo tsprintf("\n");
|
||||
foreach ($build_map as $build_item) {
|
||||
$revision_ref = $build_item['revisionRef'];
|
||||
$revision_view = $revision_ref->newRefView();
|
||||
|
||||
echo tsprintf('%s', $revision_ref->newDisplayRef());
|
||||
$buildable_ref = $revision_ref->getBuildableRef();
|
||||
$buildable_view = $buildable_ref->newRefView();
|
||||
|
||||
$raw_uri = $buildable_ref->getURI();
|
||||
$raw_uri = $workflow->getAbsoluteURI($raw_uri);
|
||||
$buildable_view->setURI($raw_uri);
|
||||
|
||||
$revision_view->addChild($buildable_view);
|
||||
|
||||
foreach ($build_item['buildRefs'] as $build_ref) {
|
||||
echo tsprintf('%s', $build_ref->newDisplayRef());
|
||||
$build_view = $build_ref->newRefView();
|
||||
$buildable_view->addChild($build_view);
|
||||
}
|
||||
|
||||
echo tsprintf('%s', $revision_view);
|
||||
echo tsprintf("\n");
|
||||
}
|
||||
|
||||
echo tsprintf(
|
||||
"\n%s\n",
|
||||
pht('You can review build details here:'));
|
||||
|
||||
// TODO: Only show buildables with problem builds.
|
||||
|
||||
$workflow = $this->getWorkflow();
|
||||
|
||||
foreach ($buildable_refs as $buildable) {
|
||||
$display_ref = $buildable->newDisplayRef();
|
||||
|
||||
$raw_uri = $buildable->getURI();
|
||||
$raw_uri = $workflow->getAbsoluteURI($raw_uri);
|
||||
|
||||
$display_ref->setURI($raw_uri);
|
||||
|
||||
echo tsprintf('%s', $display_ref);
|
||||
}
|
||||
|
||||
$this->getWorkflow()
|
||||
->getPrompt($prompt_key)
|
||||
->setQuery($query)
|
||||
|
@ -777,7 +770,7 @@ abstract class ArcanistLandEngine
|
|||
|
||||
echo tsprintf(
|
||||
"\n%s",
|
||||
$revision_ref->newDisplayRef());
|
||||
$revision_ref->newRefView());
|
||||
|
||||
foreach ($set->getCommits() as $commit) {
|
||||
$is_implicit = $commit->getIsImplicitCommit();
|
||||
|
@ -969,7 +962,7 @@ abstract class ArcanistLandEngine
|
|||
foreach ($revision_refs as $revision_ref) {
|
||||
echo tsprintf(
|
||||
'%s',
|
||||
$revision_ref->newDisplayRef());
|
||||
$revision_ref->newRefView());
|
||||
}
|
||||
|
||||
echo tsprintf("\n");
|
||||
|
|
|
@ -108,7 +108,7 @@ final class ArcanistMercurialLandEngine
|
|||
$marker_type));
|
||||
|
||||
foreach ($named_markers as $named_marker) {
|
||||
echo tsprintf('%s', $named_marker->newDisplayRef());
|
||||
echo tsprintf('%s', $named_marker->newRefView());
|
||||
}
|
||||
|
||||
echo tsprintf("\n");
|
||||
|
@ -327,7 +327,7 @@ final class ArcanistMercurialLandEngine
|
|||
pht('These branches were selected:'));
|
||||
|
||||
foreach ($branches as $branch) {
|
||||
echo tsprintf('%s', $branch->newDisplayRef());
|
||||
echo tsprintf('%s', $branch->newRefView());
|
||||
}
|
||||
|
||||
echo tsprintf("\n");
|
||||
|
@ -352,7 +352,7 @@ final class ArcanistMercurialLandEngine
|
|||
|
||||
|
||||
foreach ($new_markers as $new_marker) {
|
||||
echo tsprintf('%s', $new_marker->newDisplayRef());
|
||||
echo tsprintf('%s', $new_marker->newRefView());
|
||||
}
|
||||
|
||||
echo tsprintf("\n");
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<?php
|
||||
|
||||
interface ArcanistDisplayRefInterface {
|
||||
|
||||
public function getDisplayRefObjectName();
|
||||
public function getDisplayRefTitle();
|
||||
|
||||
}
|
|
@ -5,8 +5,17 @@ abstract class ArcanistRef
|
|||
|
||||
abstract public function getRefDisplayName();
|
||||
|
||||
final public function newDisplayRef() {
|
||||
return id(new ArcanistDisplayRef())
|
||||
final public function newRefView() {
|
||||
$ref_view = id(new ArcanistRefView())
|
||||
->setRef($this);
|
||||
|
||||
$this->buildRefView($ref_view);
|
||||
|
||||
return $ref_view;
|
||||
}
|
||||
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistDisplayRef
|
||||
final class ArcanistRefView
|
||||
extends Phobject
|
||||
implements
|
||||
ArcanistTerminalStringInterface {
|
||||
|
||||
private $objectName;
|
||||
private $title;
|
||||
private $ref;
|
||||
private $uri;
|
||||
private $lines = array();
|
||||
private $children = array();
|
||||
|
||||
public function setRef(ArcanistRef $ref) {
|
||||
$this->ref = $ref;
|
||||
|
@ -18,6 +21,24 @@ final class ArcanistDisplayRef
|
|||
return $this->ref;
|
||||
}
|
||||
|
||||
public function setObjectName($object_name) {
|
||||
$this->objectName = $object_name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getObjectName() {
|
||||
return $this->objectName;
|
||||
}
|
||||
|
||||
public function setTitle($title) {
|
||||
$this->title = $title;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setURI($uri) {
|
||||
$this->uri = $uri;
|
||||
return $this;
|
||||
|
@ -27,21 +48,29 @@ final class ArcanistDisplayRef
|
|||
return $this->uri;
|
||||
}
|
||||
|
||||
public function addChild(ArcanistRefView $view) {
|
||||
$this->children[] = $view;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function getChildren() {
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
public function appendLine($line) {
|
||||
$this->lines[] = $line;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function newTerminalString() {
|
||||
return $this->newLines(0);
|
||||
}
|
||||
|
||||
private function newLines($indent) {
|
||||
$ref = $this->getRef();
|
||||
|
||||
if ($ref instanceof ArcanistDisplayRefInterface) {
|
||||
$object_name = $ref->getDisplayRefObjectName();
|
||||
$title = $ref->getDisplayRefTitle();
|
||||
} else {
|
||||
$object_name = null;
|
||||
$title = $ref->getRefDisplayName();
|
||||
}
|
||||
$object_name = $this->getObjectName();
|
||||
$title = $this->getTitle();
|
||||
|
||||
if ($object_name !== null) {
|
||||
$reserve_width = phutil_utf8_console_strlen($object_name) + 1;
|
||||
|
@ -49,10 +78,18 @@ final class ArcanistDisplayRef
|
|||
$reserve_width = 0;
|
||||
}
|
||||
|
||||
if ($indent) {
|
||||
$indent_text = str_repeat(' ', $indent);
|
||||
} else {
|
||||
$indent_text = '';
|
||||
}
|
||||
$indent_width = strlen($indent_text);
|
||||
|
||||
$marker_width = 6;
|
||||
$display_width = phutil_console_get_terminal_width();
|
||||
|
||||
$usable_width = ($display_width - $marker_width - $reserve_width);
|
||||
$usable_width = ($usable_width - $indent_width);
|
||||
|
||||
// If the terminal is extremely narrow, don't degrade so much that the
|
||||
// output is completely unusable.
|
||||
|
@ -75,22 +112,32 @@ final class ArcanistDisplayRef
|
|||
$display_text = $title;
|
||||
}
|
||||
|
||||
$ref = $this->getRef();
|
||||
$output = array();
|
||||
|
||||
$output[] = tsprintf(
|
||||
"<bg:cyan>** * **</bg> %s\n",
|
||||
"<bg:cyan>** * **</bg> %s%s\n",
|
||||
$indent_text,
|
||||
$display_text);
|
||||
|
||||
$uri = $this->getURI();
|
||||
if ($uri !== null) {
|
||||
$output[] = tsprintf(
|
||||
"<bg:cyan>** :// **</bg> __%s__\n",
|
||||
"<bg:cyan>** :// **</bg> %s__%s__\n",
|
||||
$indent_text,
|
||||
$uri);
|
||||
}
|
||||
|
||||
foreach ($this->lines as $line) {
|
||||
$output[] = tsprintf(" %s\n", $line);
|
||||
$output[] = tsprintf(
|
||||
" %s%s\n",
|
||||
$indent_text,
|
||||
$line);
|
||||
}
|
||||
|
||||
foreach ($this->getChildren() as $child) {
|
||||
foreach ($child->newLines($indent + 1) as $line) {
|
||||
$output[] = $line;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistBuildRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
const HARDPOINT_BUILDPLANREF = 'ref.build.buildplanRef';
|
||||
|
||||
|
@ -16,7 +14,7 @@ final class ArcanistBuildRef
|
|||
}
|
||||
|
||||
public function getRefDisplayName() {
|
||||
return $this->getDisplayRefObjectName();
|
||||
return pht('Build %d', $this->getID());
|
||||
}
|
||||
|
||||
public static function newFromConduit(array $parameters) {
|
||||
|
@ -37,12 +35,10 @@ final class ArcanistBuildRef
|
|||
return idxv($this->parameters, array('fields', 'name'));
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
return pht('Build %d', $this->getID());
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
return $this->getName();
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$view
|
||||
->setObjectName($this->getRefDisplayName())
|
||||
->setTitle($this->getName());
|
||||
}
|
||||
|
||||
public function getBuildPlanRef() {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistBuildableRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
const HARDPOINT_BUILDREFS = 'ref.buildable.buildRefs';
|
||||
|
||||
|
@ -44,12 +42,10 @@ final class ArcanistBuildableRef
|
|||
return 'B'.$this->getID();
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
return $this->getMonogram();
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
return pht('Buildable %d', $this->getID());
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$view
|
||||
->setObjectName($this->getMonogram())
|
||||
->setTitle($this->getRefDisplayName());
|
||||
}
|
||||
|
||||
public function getBuildRefs() {
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistBuildPlanRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
private $parameters;
|
||||
|
||||
public function getRefDisplayName() {
|
||||
return $this->getDisplayRefObjectName();
|
||||
return pht('Build Plan %d', $this->getID());
|
||||
}
|
||||
|
||||
public static function newFromConduit(array $parameters) {
|
||||
|
@ -29,14 +27,6 @@ final class ArcanistBuildPlanRef
|
|||
return idxv($this->parameters, array('fields', 'name'));
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
return pht('Build Plan %d', $this->getID());
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
return $this->getName();
|
||||
}
|
||||
|
||||
public function getBehavior($behavior_key, $default = null) {
|
||||
return idxv(
|
||||
$this->parameters,
|
||||
|
@ -44,4 +34,10 @@ final class ArcanistBuildPlanRef
|
|||
$default);
|
||||
}
|
||||
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$view
|
||||
->setObjectName($this->getRefDisplayName())
|
||||
->setTitle($this->getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistFileRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
private $parameters;
|
||||
|
||||
|
@ -51,12 +49,10 @@ final class ArcanistFileRef
|
|||
return 'F'.$this->getID();
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
return $this->getMonogram();
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
return $this->getName();
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$view
|
||||
->setObjectName($this->getMonogram())
|
||||
->setTitle($this->getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistPasteRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
private $parameters;
|
||||
|
||||
|
@ -47,12 +45,10 @@ final class ArcanistPasteRef
|
|||
return 'P'.$this->getID();
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
return $this->getMonogram();
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
return $this->getTitle();
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$view
|
||||
->setObjectName($this->getMonogram())
|
||||
->setTitle($this->getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistRevisionRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
const HARDPOINT_COMMITMESSAGE = 'ref.revision.commitmessage';
|
||||
const HARDPOINT_AUTHORREF = 'ref.revision.authorRef';
|
||||
|
@ -167,12 +165,10 @@ final class ArcanistRevisionRef
|
|||
return $this->getHardpoint(self::HARDPOINT_BUILDABLEREF);
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
return $this->getMonogram();
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
return $this->getName();
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$view
|
||||
->setObjectName($this->getMonogram())
|
||||
->setTitle($this->getTitle());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistTaskRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
private $parameters;
|
||||
|
||||
|
@ -33,12 +31,10 @@ final class ArcanistTaskRef
|
|||
return 'T'.$this->getID();
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
return $this->getMonogram();
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
return $this->getName();
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$view
|
||||
->setObjectName($this->getMonogram())
|
||||
->setTitle($this->getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistUserRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
private $parameters;
|
||||
|
||||
|
@ -49,18 +47,16 @@ final class ArcanistUserRef
|
|||
return idxv($this->parameters, array('fields', 'realName'));
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
return $this->getMonogram();
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$real_name = $this->getRealName();
|
||||
|
||||
if (strlen($real_name)) {
|
||||
$real_name = sprintf('(%s)', $real_name);
|
||||
}
|
||||
|
||||
return $real_name;
|
||||
$view
|
||||
->setObjectName($this->getMonogram())
|
||||
->setTitle($real_name);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
final class ArcanistMarkerRef
|
||||
extends ArcanistRef
|
||||
implements
|
||||
ArcanistDisplayRefInterface {
|
||||
extends ArcanistRef {
|
||||
|
||||
const HARDPOINT_COMMITREF = 'arc.marker.commitRef';
|
||||
const HARDPOINT_WORKINGCOPYSTATEREF = 'arc.marker.workingCopyStateRef';
|
||||
|
@ -24,10 +22,6 @@ final class ArcanistMarkerRef
|
|||
private $isActive = false;
|
||||
|
||||
public function getRefDisplayName() {
|
||||
return $this->getDisplayRefObjectName();
|
||||
}
|
||||
|
||||
public function getDisplayRefObjectName() {
|
||||
switch ($this->getMarkerType()) {
|
||||
case self::TYPE_BRANCH:
|
||||
return pht('Branch "%s"', $this->getName());
|
||||
|
@ -38,13 +32,6 @@ final class ArcanistMarkerRef
|
|||
}
|
||||
}
|
||||
|
||||
public function getDisplayRefTitle() {
|
||||
return pht(
|
||||
'%s %s',
|
||||
$this->getDisplayHash(),
|
||||
$this->getSummary());
|
||||
}
|
||||
|
||||
protected function newHardpoints() {
|
||||
return array(
|
||||
$this->newHardpoint(self::HARDPOINT_COMMITREF),
|
||||
|
@ -98,8 +85,6 @@ final class ArcanistMarkerRef
|
|||
return $this->displayHash;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function setCommitHash($commit_hash) {
|
||||
$this->commitHash = $commit_hash;
|
||||
return $this;
|
||||
|
@ -177,4 +162,15 @@ final class ArcanistMarkerRef
|
|||
return $this->getHardpoint(self::HARDPOINT_REMOTEREF);
|
||||
}
|
||||
|
||||
protected function buildRefView(ArcanistRefView $view) {
|
||||
$title = pht(
|
||||
'%s %s',
|
||||
$this->getDisplayHash(),
|
||||
$this->getSummary());
|
||||
|
||||
$view
|
||||
->setObjectName($this->getRefDisplayName())
|
||||
->setTitle($title);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ abstract class ArcanistWorkEngine
|
|||
$revision_ref->getMonogram()));
|
||||
|
||||
foreach ($selected as $marker) {
|
||||
echo tsprintf('%s', $marker->newDisplayRef());
|
||||
echo tsprintf('%s', $marker->newRefView());
|
||||
}
|
||||
|
||||
echo tsprintf("\n");
|
||||
|
@ -177,7 +177,7 @@ abstract class ArcanistWorkEngine
|
|||
pht('REVISION'),
|
||||
pht('Resuming work on revision:'));
|
||||
|
||||
echo tsprintf('%s', $revision_ref->newDisplayRef());
|
||||
echo tsprintf('%s', $revision_ref->newRefView());
|
||||
echo tsprintf("\n");
|
||||
|
||||
return $target;
|
||||
|
|
|
@ -108,7 +108,7 @@ EOTEXT
|
|||
echo tsprintf(
|
||||
"%s\n\n%s\n",
|
||||
pht('Amending commit message to reflect revision:'),
|
||||
$revision_ref->newDisplayRef());
|
||||
$revision_ref->newRefView());
|
||||
|
||||
$this->confirmAmendAuthor($revision_ref);
|
||||
$this->confirmAmendNotFound($revision_ref, $state_ref);
|
||||
|
@ -193,7 +193,7 @@ EOTEXT
|
|||
"%!\n%W\n\n%B\n",
|
||||
pht('MULTIPLE REVISIONS IN WORKING COPY'),
|
||||
pht('More than one revision was found in the working copy:'),
|
||||
mpull($revisions, 'newDisplayRef'));
|
||||
mpull($revisions, 'newRefView'));
|
||||
|
||||
throw new PhutilArgumentUsageException(
|
||||
pht(
|
||||
|
@ -233,7 +233,7 @@ EOTEXT
|
|||
'The author of this revision (%s) is:',
|
||||
$revision_ref->getMonogram()),
|
||||
),
|
||||
$author_ref->newDisplayRef());
|
||||
$author_ref->newRefView());
|
||||
|
||||
$prompt = pht(
|
||||
'Amend working copy using revision owned by %s?',
|
||||
|
|
|
@ -159,7 +159,7 @@ EOTEXT
|
|||
|
||||
echo tsprintf(
|
||||
'%s',
|
||||
$paste_ref->newDisplayRef()
|
||||
$paste_ref->newRefView()
|
||||
->setURI($uri));
|
||||
|
||||
if ($is_browse) {
|
||||
|
|
|
@ -119,7 +119,7 @@ EOTEXT
|
|||
$uri = $this->getAbsoluteURI($uri);
|
||||
echo tsprintf(
|
||||
'%s',
|
||||
$ref->newDisplayRef()
|
||||
$ref->newRefView()
|
||||
->setURI($uri));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue