From 78fba426f6616c0024849da9408966ff8ea4adc1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 18 Feb 2016 03:09:59 -0800 Subject: [PATCH] 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 --- scripts/symbols/clear_repository_symbols.php | 16 +++++++++------- scripts/symbols/import_repository_symbols.php | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/scripts/symbols/clear_repository_symbols.php b/scripts/symbols/clear_repository_symbols.php index 8807262cd5..701034c6cc 100755 --- a/scripts/symbols/clear_repository_symbols.php +++ b/scripts/symbols/clear_repository_symbols.php @@ -6,7 +6,7 @@ require_once $root.'/scripts/__init_script__.php'; $args = new PhutilArgumentParser($argv); $args->setSynopsis(<<parseStandardArguments(); $args->parse( array( array( - 'name' => 'callsign', + 'name' => 'repository', 'wildcard' => true, ), )); -$callsigns = $args->getArg('callsign'); -if (count($callsigns) !== 1) { +$identifiers = $args->getArg('repository'); +if (count($identifiers) !== 1) { $args->printHelpAndExit(); } -$callsign = head($callsigns); +$identifier = head($identifiers); $repository = id(new PhabricatorRepositoryQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) - ->withCallsigns($callsigns) + ->withIdentifiers($identifiers) ->executeOne(); if (!$repository) { - echo pht("Repository '%s' does not exist.", $callsign); + echo tsprintf( + "%s\n", + pht('Repository "%s" does not exist.', $identifier)); exit(1); } diff --git a/scripts/symbols/import_repository_symbols.php b/scripts/symbols/import_repository_symbols.php index c8dabc8508..b84aea3485 100755 --- a/scripts/symbols/import_repository_symbols.php +++ b/scripts/symbols/import_repository_symbols.php @@ -6,7 +6,7 @@ require_once $root.'/scripts/__init_script__.php'; $args = new PhutilArgumentParser($argv); $args->setSynopsis(<<parse( 'be part of a single transaction.'), ), array( - 'name' => 'callsign', + 'name' => 'repository', 'wildcard' => true, ), )); -$callsigns = $args->getArg('callsign'); -if (count($callsigns) !== 1) { +$identifiers = $args->getArg('repository'); +if (count($identifiers) !== 1) { $args->printHelpAndExit(); } -$callsign = head($callsigns); +$identifier = head($identifiers); $repository = id(new PhabricatorRepositoryQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) - ->withCallsigns($callsigns) + ->withIdentifiers($identifiers) ->executeOne(); if (!$repository) { - echo pht("Repository '%s' does not exist.", $callsign); + echo tsprintf( + "%s\n", + pht('Repository "%s" does not exist.', $identifier)); exit(1); }