]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Make arc install-certificate respect --conduit-uri
authorBob Trahan <bob.trahan@gmail.com>
Mon, 23 Jan 2012 23:31:56 +0000 (15:31 -0800)
committerBob Trahan <bob.trahan@gmail.com>
Mon, 23 Jan 2012 23:44:25 +0000 (15:44 -0800)
Summary: ...basically by adding "getConduitURI" and then falling through to
that, rather than repeating work from the main arc wrapper that setConduitURI in
the first place.   The explicit drawback here is the error message gets a little
more vague.

Test Plan:
- arc install-certifate --conduit-uri=https://secure.phabricator.com
// verified that the install flow was going for
https://secure.phabricator.com...!
- arc install-certificate https://secure.phabricator.com
// verified that the install flow was going for
https://secure.phabricator.com...!
- arc install-certificate
// verified that it reverted back to the .arcconfig conduit uri

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley
Maniphest Tasks: T794

Differential Revision: https://secure.phabricator.com/D1468

src/workflow/base/ArcanistBaseWorkflow.php
src/workflow/install-certificate/ArcanistInstallCertificateWorkflow.php
src/workflow/install-certificate/__init__.php

index 2960505d3e7250fa60a97cc05a97771bb3e160a8..b8b8f02422e1a19cea74129c6f99ce404d70cd9f 100644 (file)
@@ -96,6 +96,15 @@ class ArcanistBaseWorkflow {
     return $this;
   }
 
+  /**
+   * Returns the URI the conduit connection within the workflow uses.
+   *
+   * @return string
+   * @task conduit
+   */
+  final public function getConduitURI() {
+    return $this->conduitURI;
+  }
 
   /**
    * Open a conduit channel to the server which was previously configured by
index fa307f6032f2b4c62f4a52c7cb2e815e2df2b2fe..eea0cffadb52fabfd14ad840c2be3e35c5ad7f74 100644 (file)
@@ -132,18 +132,12 @@ EOTEXT
     } else if (count($uri) == 1) {
       $uri = reset($uri);
     } else {
-      $working_copy = ArcanistWorkingCopyIdentity::newFromPath(
-        $this->getWorkingDirectory());
-      if (!$working_copy->getProjectRoot()) {
+      $conduit_uri = $this->getConduitURI();
+      if (!$conduit_uri) {
         throw new ArcanistUsageException(
           "Specify an explicit URI or run this command from within a project ".
           "which is configured with a .arcconfig.");
       }
-      $conduit_uri = $working_copy->getConduitURI();
-      if (!$conduit_uri) {
-        throw new ArcanistUsageException(
-          "This project's .arcconfig does not specify a Conduit URI.");
-      }
       $uri = $conduit_uri;
     }
 
index f6b42a3f39d96d57ee40de1670cdb166c6a84e29..ad6ca17ef9e7823e8c3f6829a12d24a2c444ce5f 100644 (file)
@@ -8,7 +8,6 @@
 
 phutil_require_module('arcanist', 'exception/usage');
 phutil_require_module('arcanist', 'workflow/base');
-phutil_require_module('arcanist', 'workingcopyidentity');
 
 phutil_require_module('phutil', 'conduit/client');
 phutil_require_module('phutil', 'console');