mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
599ba0f999
Summary: Ref T13546. Various Arcanist workflows, and particularly the MercurialAPI, currently repeat quite a lot of code around parsing branches and bookmarks. In modern Mercurial, we can generally use the "head()" and "bookmark()" revsets to do this fairly sensibly. This change mostly adds //more// code (and introduces "arc bookmarks" and "arc branches" as replacements for "arc bookmark" and "arc branch") but followups should be able to mostly delete code. Test Plan: Ran "arc branches" and "arc bookmarks" in Git and Mercurial. Maniphest Tasks: T13546 Differential Revision: https://secure.phabricator.com/D21333
43 lines
1 KiB
PHP
43 lines
1 KiB
PHP
<?php
|
|
|
|
final class ArcanistBookmarksWorkflow
|
|
extends ArcanistMarkersWorkflow {
|
|
|
|
public function getWorkflowName() {
|
|
return 'bookmarks';
|
|
}
|
|
|
|
public function getWorkflowArguments() {
|
|
return array();
|
|
}
|
|
|
|
public function getWorkflowInformation() {
|
|
$help = pht(<<<EOHELP
|
|
Lists bookmarks in the working copy, annotated with additional information
|
|
about review status.
|
|
EOHELP
|
|
);
|
|
|
|
return $this->newWorkflowInformation()
|
|
->setSynopsis(
|
|
pht('Show an enhanced view of bookmarks in the working copy.'))
|
|
->addExample(pht('**bookmarks**'))
|
|
->setHelp($help);
|
|
}
|
|
|
|
protected function getWorkflowMarkerType() {
|
|
$api = $this->getRepositoryAPI();
|
|
$marker_type = ArcanistMarkerRef::TYPE_BOOKMARK;
|
|
|
|
if (!$this->hasMarkerTypeSupport($marker_type)) {
|
|
throw new PhutilArgumentUsageException(
|
|
pht(
|
|
'The version control system ("%s") in the current working copy '.
|
|
'does not support bookmarks.',
|
|
$api->getSourceControlSystemName()));
|
|
}
|
|
|
|
return $marker_type;
|
|
}
|
|
|
|
}
|