Skip to content

Commit 78fba42

Browse files
author
epriestley
committedFeb 18, 2016
Update import/clear symbols scripts for callsigns
Summary: Ref T4245. Accept identifiers instead of callsigns in these scripts so things continue to work in a future callsign-optional world. Test Plan: Ran these scripts with both valid and invalid arguments; saw success and errors. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4245 Differential Revision: https://secure.phabricator.com/D15300
1 parent f557fc9 commit 78fba42

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed
 

‎scripts/symbols/clear_repository_symbols.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
$args = new PhutilArgumentParser($argv);
88
$args->setSynopsis(<<<EOSYNOPSIS
9-
**clear_repository_symbols.php** [__options__] __callsign__
9+
**clear_repository_symbols.php** [__options__] __repository__
1010
1111
Clear repository symbols.
1212
EOSYNOPSIS
@@ -15,24 +15,26 @@
1515
$args->parse(
1616
array(
1717
array(
18-
'name' => 'callsign',
18+
'name' => 'repository',
1919
'wildcard' => true,
2020
),
2121
));
2222

23-
$callsigns = $args->getArg('callsign');
24-
if (count($callsigns) !== 1) {
23+
$identifiers = $args->getArg('repository');
24+
if (count($identifiers) !== 1) {
2525
$args->printHelpAndExit();
2626
}
2727

28-
$callsign = head($callsigns);
28+
$identifier = head($identifiers);
2929
$repository = id(new PhabricatorRepositoryQuery())
3030
->setViewer(PhabricatorUser::getOmnipotentUser())
31-
->withCallsigns($callsigns)
31+
->withIdentifiers($identifiers)
3232
->executeOne();
3333

3434
if (!$repository) {
35-
echo pht("Repository '%s' does not exist.", $callsign);
35+
echo tsprintf(
36+
"%s\n",
37+
pht('Repository "%s" does not exist.', $identifier));
3638
exit(1);
3739
}
3840

‎scripts/symbols/import_repository_symbols.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
$args = new PhutilArgumentParser($argv);
88
$args->setSynopsis(<<<EOSYNOPSIS
9-
**import_repository_symbols.php** [__options__] __callsign__ < symbols
9+
**import_repository_symbols.php** [__options__] __repository__ < symbols
1010
1111
Import repository symbols (symbols are read from stdin).
1212
EOSYNOPSIS
@@ -35,24 +35,26 @@
3535
'be part of a single transaction.'),
3636
),
3737
array(
38-
'name' => 'callsign',
38+
'name' => 'repository',
3939
'wildcard' => true,
4040
),
4141
));
4242

43-
$callsigns = $args->getArg('callsign');
44-
if (count($callsigns) !== 1) {
43+
$identifiers = $args->getArg('repository');
44+
if (count($identifiers) !== 1) {
4545
$args->printHelpAndExit();
4646
}
4747

48-
$callsign = head($callsigns);
48+
$identifier = head($identifiers);
4949
$repository = id(new PhabricatorRepositoryQuery())
5050
->setViewer(PhabricatorUser::getOmnipotentUser())
51-
->withCallsigns($callsigns)
51+
->withIdentifiers($identifiers)
5252
->executeOne();
5353

5454
if (!$repository) {
55-
echo pht("Repository '%s' does not exist.", $callsign);
55+
echo tsprintf(
56+
"%s\n",
57+
pht('Repository "%s" does not exist.', $identifier));
5658
exit(1);
5759
}
5860

0 commit comments

Comments
 (0)
Failed to load comments.