forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhabricatorRepositoryManagementPullWorkflow.php
58 lines (49 loc) · 1.54 KB
/
PhabricatorRepositoryManagementPullWorkflow.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
final class PhabricatorRepositoryManagementPullWorkflow
extends PhabricatorRepositoryManagementWorkflow {
protected function didConstruct() {
$this
->setName('pull')
->setExamples('**pull** __repository__ ...')
->setSynopsis(pht('Pull __repository__.'))
->setArguments(
array(
array(
'name' => 'verbose',
'help' => pht('Show additional debugging information.'),
),
array(
'name' => 'ignore-locality',
'help' => pht(
'Pull even if the repository should not be present on this '.
'host according to repository cluster configuration.'),
),
array(
'name' => 'repos',
'wildcard' => true,
),
));
}
public function execute(PhutilArgumentParser $args) {
$ignore_locality = (bool)$args->getArg('ignore-locality');
$repos = $this->loadLocalRepositories($args, 'repos', $ignore_locality);
if (!$repos) {
throw new PhutilArgumentUsageException(
pht('Specify one or more repositories to pull.'));
}
$console = PhutilConsole::getConsole();
foreach ($repos as $repo) {
$console->writeOut(
"%s\n",
pht(
'Pulling "%s"...',
$repo->getDisplayName()));
id(new PhabricatorRepositoryPullEngine())
->setRepository($repo)
->setVerbose($args->getArg('verbose'))
->pullRepository();
}
$console->writeOut("%s\n", pht('Done.'));
return 0;
}
}