2011-06-23 21:10:59 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2013-01-31 02:33:32 +01:00
|
|
|
* Alias for arc feature
|
2011-06-23 21:10:59 +02:00
|
|
|
*
|
|
|
|
* @group workflow
|
|
|
|
*/
|
2013-01-31 02:33:32 +01:00
|
|
|
final class ArcanistBranchWorkflow extends ArcanistFeatureWorkflow {
|
2011-06-23 21:10:59 +02:00
|
|
|
|
Make Arcanist workflow names explicit
Summary:
Currently, adding a new workflow requires you to override ArcanistConfiguration, which is messy. Instead, just load everything that extends ArcanistBaseWorkflow.
Remove all the rules tying workflow names to class names through arcane incantations.
This has a very small performance cost in that we need to load every Workflow class every time now, but we don't hit __init__ and such anymore and it was pretty negligible on my machine (98ms vs 104ms or something).
Test Plan: Ran "arc help", "arc which", "arc diff", etc.
Reviewers: edward, vrana, btrahan
Reviewed By: edward
CC: aran, zeeg
Differential Revision: https://secure.phabricator.com/D3691
2012-10-17 17:35:03 +02:00
|
|
|
public function getWorkflowName() {
|
|
|
|
return 'branch';
|
|
|
|
}
|
|
|
|
|
2012-03-05 19:02:37 +01:00
|
|
|
public function getCommandSynopses() {
|
2011-06-23 21:10:59 +02:00
|
|
|
return phutil_console_format(<<<EOTEXT
|
2012-06-26 19:50:43 +02:00
|
|
|
**branch** [__options__]
|
2012-12-12 23:01:26 +01:00
|
|
|
**branch** __name__ [__start__]
|
2012-03-05 19:02:37 +01:00
|
|
|
EOTEXT
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCommandHelp() {
|
|
|
|
return phutil_console_format(<<<EOTEXT
|
2011-06-23 21:10:59 +02:00
|
|
|
Supports: git
|
2013-01-31 02:33:32 +01:00
|
|
|
Alias for arc feature.
|
2011-06-23 21:10:59 +02:00
|
|
|
EOTEXT
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function run() {
|
|
|
|
$repository_api = $this->getRepositoryAPI();
|
|
|
|
if (!($repository_api instanceof ArcanistGitAPI)) {
|
|
|
|
throw new ArcanistUsageException(
|
2013-01-31 02:33:32 +01:00
|
|
|
'arc branch is only supported under Git.');
|
2011-06-23 21:10:59 +02:00
|
|
|
}
|
2013-01-31 02:33:32 +01:00
|
|
|
return parent::run();
|
2011-06-23 21:10:59 +02:00
|
|
|
}
|
2012-06-26 19:50:43 +02:00
|
|
|
|
2011-06-23 21:10:59 +02:00
|
|
|
}
|