]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Improve some messaging in `arc which` for autodetection of repositories
authorepriestley <git@epriestley.com>
Tue, 28 Jan 2014 03:45:18 +0000 (19:45 -0800)
committerepriestley <git@epriestley.com>
Tue, 28 Jan 2014 03:45:18 +0000 (19:45 -0800)
Summary:
  - The modern name for the config is "project.name".
  - Missing parameter in a pht().
  - When the value is set, but not valid, we gave you a misleading error message.

Test Plan: Ran `arc which`.

Reviewers: talshiri, btrahan

Reviewed By: talshiri

CC: aran
Differential Revision: https://secure.phabricator.com/D8081

src/workflow/ArcanistBaseWorkflow.php

index dea5bb89a15511adc6dbc75a2ca2f3e68fb4830e..cb5e27a5dbc15a69152135ac74f8cdaf81d1c9cc 100644 (file)
@@ -1650,6 +1650,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
     }
 
     $project_info = $this->getProjectInfo();
+    $project_name = $this->getWorkingCopy()->getProjectID();
     if ($this->getProjectInfo()) {
       if (!empty($project_info['repository']['callsign'])) {
         $callsign = $project_info['repository']['callsign'];
@@ -1657,19 +1658,25 @@ abstract class ArcanistBaseWorkflow extends Phobject {
           'callsigns' => array($callsign),
         );
         $reasons[] = pht(
-          'Configuration value "project.id" is set to "%s"; this project '.
+          'Configuration value "project.name" is set to "%s"; this project '.
           'is associated with the "%s" repository.',
-          $this->getWorkingCopy()->getProjectID(),
+          $project_name,
           $callsign);
         return array($query, $reasons);
       } else {
         $reasons[] = pht(
-          'Configuration value "project.id" is set to "%s", but this '.
-          'project is not associated with a repository.');
+          'Configuration value "project.name" is set to "%s", but this '.
+          'project is not associated with a repository.',
+          $project_name);
       }
+    } else if (strlen($project_name)) {
+      $reasons[] = pht(
+        'Configuration value "project.name" is set to "%s", but that '.
+        'project does not exist.',
+        $project_name);
     } else {
       $reasons[] = pht(
-        'Configuration value "project.id" is empty.');
+        'Configuration value "project.name" is empty.');
     }
 
     $uuid = $this->getRepositoryAPI()->getRepositoryUUID();