1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-26 15:30:57 +01:00

hack up arc patch to not differential.query if its not authenticated

Summary: 'cuz the method would fail without authentication!  see D1604 for some
discussion on approaches here

Test Plan: ran arc patch and it worked

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley, johnduhart

Maniphest Tasks: T856

Differential Revision: https://secure.phabricator.com/D1645
This commit is contained in:
Bob Trahan 2012-02-19 15:24:03 -08:00
parent b24c228b5c
commit 298ed9cda5
2 changed files with 16 additions and 2 deletions

View file

@ -158,7 +158,7 @@ abstract class ArcanistBaseWorkflow {
* @task conduit
*/
final public function setConduitCredentials(array $credentials) {
if ($this->conduitAuthenticated) {
if ($this->isConduitAuthenticated()) {
throw new Exception(
"You may not set new credentials after authenticating conduit.");
}
@ -196,7 +196,7 @@ abstract class ArcanistBaseWorkflow {
* @task conduit
*/
final public function authenticateConduit() {
if ($this->conduitAuthenticated) {
if ($this->isConduitAuthenticated()) {
return $this;
}
@ -258,6 +258,14 @@ abstract class ArcanistBaseWorkflow {
return $this;
}
/**
* @return bool True if conduit is authenticated, false otherwise.
* @task conduit
*/
final protected function isConduitAuthenticated() {
return (bool) $this->conduitAuthenticated;
}
/**
* Override this to return true if your workflow requires a conduit channel.

View file

@ -770,6 +770,12 @@ EOTEXT
}
private function loadRevisionFromHash($hash) {
// TODO -- de-hack this as permissions become more clear with things
// like T848 (add scope to OAuth)
if (!$this->isConduitAuthenticated()) {
return null;
}
$conduit = $this->getConduit();
$revisions = $conduit->callMethodSynchronous(