Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistWorkflow.php
Show First 20 Lines • Show All 528 Lines • ▼ Show 20 Lines | try { | ||||
)); | )); | ||||
} catch (ConduitClientException $ex) { | } catch (ConduitClientException $ex) { | ||||
if ($ex->getErrorCode() == 'ERR-NO-CERTIFICATE' || | if ($ex->getErrorCode() == 'ERR-NO-CERTIFICATE' || | ||||
$ex->getErrorCode() == 'ERR-INVALID-USER' || | $ex->getErrorCode() == 'ERR-INVALID-USER' || | ||||
$ex->getErrorCode() == 'ERR-INVALID-AUTH') { | $ex->getErrorCode() == 'ERR-INVALID-AUTH') { | ||||
$conduit_uri = $this->conduitURI; | $conduit_uri = $this->conduitURI; | ||||
$message = phutil_console_format( | $message = phutil_console_format( | ||||
"\n%s\n\n %s\n\n%s\n%s", | "\n%s\n\n %s\n\n%s\n%s", | ||||
pht('YOU NEED TO __INSTALL A CERTIFICATE__ TO LOGIN TO PHABRICATOR'), | pht('YOU NEED TO __INSTALL A CERTIFICATE__ TO LOG IN'), | ||||
pht('To do this, run: **%s**', 'arc install-certificate'), | pht('To do this, run: **%s**', 'arc install-certificate'), | ||||
pht("The server '%s' rejected your request:", $conduit_uri), | pht("The server '%s' rejected your request:", $conduit_uri), | ||||
$ex->getMessage()); | $ex->getMessage()); | ||||
throw new ArcanistUsageException($message); | throw new ArcanistUsageException($message); | ||||
} else if ($ex->getErrorCode() == 'NEW-ARC-VERSION') { | } else if ($ex->getErrorCode() == 'NEW-ARC-VERSION') { | ||||
// Cleverly disguise this as being AWESOME!!! | // Cleverly disguise this as being AWESOME!!! | ||||
▲ Show 20 Lines • Show All 1,406 Lines • ▼ Show 20 Lines | private function loadRepositoryInformation() { | ||||
try { | try { | ||||
$method = 'repository.query'; | $method = 'repository.query'; | ||||
$results = $this->getConduitEngine() | $results = $this->getConduitEngine() | ||||
->newFuture($method, $query) | ->newFuture($method, $query) | ||||
->resolve(); | ->resolve(); | ||||
} catch (ConduitClientException $ex) { | } catch (ConduitClientException $ex) { | ||||
if ($ex->getErrorCode() == 'ERR-CONDUIT-CALL') { | if ($ex->getErrorCode() == 'ERR-CONDUIT-CALL') { | ||||
$reasons[] = pht( | $reasons[] = pht( | ||||
'This version of Arcanist is more recent than the version of '. | 'This software version on the server you are connecting to is out '. | ||||
'Phabricator you are connecting to: the Phabricator install is '. | 'of date and does not have support for identifying repositories '. | ||||
'out of date and does not have support for identifying '. | 'by callsign or URI. Update the server sofwware to enable these '. | ||||
'repositories by callsign or URI. Update Phabricator to enable '. | 'features.'); | ||||
'these features.'); | |||||
return array(null, $reasons); | return array(null, $reasons); | ||||
} | } | ||||
throw $ex; | throw $ex; | ||||
} | } | ||||
$result = null; | $result = null; | ||||
if (!$results) { | if (!$results) { | ||||
$reasons[] = pht( | $reasons[] = pht( | ||||
▲ Show 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | private function getBrowserCommand() { | ||||
foreach ($candidates as $cmd => $argv) { | foreach ($candidates as $cmd => $argv) { | ||||
if (Filesystem::binaryExists($cmd)) { | if (Filesystem::binaryExists($cmd)) { | ||||
return $argv; | return $argv; | ||||
} | } | ||||
} | } | ||||
throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
pht( | pht( | ||||
"Unable to find a browser command to run. Set '%s' in your ". | 'Unable to find a browser command to run. Set "browser" in your '. | ||||
"Arcanist config to specify a command to use.", | 'configuration to specify a command to use.')); | ||||
'browser')); | |||||
} | } | ||||
/** | /** | ||||
* Ask Phabricator to update the current repository as soon as possible. | * Ask Phabricator to update the current repository as soon as possible. | ||||
* | * | ||||
* Calling this method after pushing commits allows Phabricator to discover | * Calling this method after pushing commits allows Phabricator to discover | ||||
* the commits more quickly, so the system overall is more responsive. | * the commits more quickly, so the system overall is more responsive. | ||||
▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines |