From 097bcb397061213a1eecd9bdec2a4a385b9d1f85 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 17 Feb 2016 17:20:15 -0800 Subject: [PATCH] Make `bin/diviner generate --repository ` accept identifiers Summary: Ref T4245. This currently accepts only callsigns; prepare it for the bright new callsign-optional world. Test Plan: - Ran `./bin/diviner generate --repository 1 --book src/docs/book/flavor.book --clean`, got a good result. - Ran `./bin/diviner generate --repository 239238 --book src/docs/book/flavor.book --clean`, got an appropraite error about a bad repository identifier. Reviewers: chad, avivey Reviewed By: avivey Maniphest Tasks: T4245 Differential Revision: https://secure.phabricator.com/D15296 --- .../diviner/workflow/DivinerGenerateWorkflow.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php index ad671bbbea..86b75c8480 100644 --- a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php +++ b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php @@ -27,7 +27,7 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow { ), array( 'name' => 'repository', - 'param' => 'callsign', + 'param' => 'identifier', 'help' => pht('Repository that the documentation belongs to.'), ), )); @@ -192,19 +192,19 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow { } $publisher = newv($publisher_class, array()); - $callsign = $args->getArg('repository'); + $identifier = $args->getArg('repository'); $repository = null; - if ($callsign) { + if (strlen($identifier)) { $repository = id(new PhabricatorRepositoryQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) - ->withCallsigns(array($callsign)) + ->withIdentifiers(array($identifier)) ->executeOne(); if (!$repository) { throw new PhutilArgumentUsageException( pht( - "Repository '%s' does not exist.", - $callsign)); + 'Repository "%s" does not exist.', + $identifier)); } $publisher->setRepositoryPHID($repository->getPHID());