1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

set localpath in repository.create

Summary: Since there's no way to set it, it defaults to an empty value. Make the conduit call set up sane default.

Test Plan: Call method, repo get's built with expected localpath.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9842
This commit is contained in:
Aviv Eyal 2014-07-09 15:35:24 -07:00 committed by epriestley
parent 8756d82cf6
commit 64e2aad46f

View file

@ -25,7 +25,7 @@ final class ConduitAPI_repository_create_Method
'description' => 'optional string',
'encoding' => 'optional string',
'tracking' => 'optional bool',
'uri' => 'optional string',
'uri' => 'required string',
'credentialPHID' => 'optional string',
'svnSubpath' => 'optional string',
'branchFilter' => 'optional list<string>',
@ -82,6 +82,12 @@ final class ConduitAPI_repository_create_Method
}
$repository->setCallsign($callsign);
$local_path = PhabricatorEnv::getEnvConfig(
'repository.default-local-path');
$local_path = rtrim($local_path, '/');
$local_path = $local_path.'/'.$callsign.'/';
$vcs = $request->getValue('vcs');
$map = array(
@ -104,6 +110,7 @@ final class ConduitAPI_repository_create_Method
'description' => $request->getValue('description'),
'tracking-enabled' => (bool)$request->getValue('tracking', true),
'remote-uri' => $remote_uri,
'local-path' => $local_path,
'branch-filter' => array_fill_keys(
$request->getValue('branchFilter', array()),
true),