Differential D9513 Diff 22796 src/applications/repository/conduit/ConduitAPI_repository_create_Method.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/conduit/ConduitAPI_repository_create_Method.php
Show All 24 Lines | return array( | ||||
'name' => 'required string', | 'name' => 'required string', | ||||
'vcs' => 'required '.$vcs_const, | 'vcs' => 'required '.$vcs_const, | ||||
'callsign' => 'required string', | 'callsign' => 'required string', | ||||
'description' => 'optional string', | 'description' => 'optional string', | ||||
'encoding' => 'optional string', | 'encoding' => 'optional string', | ||||
'tracking' => 'optional bool', | 'tracking' => 'optional bool', | ||||
'uri' => 'optional string', | 'uri' => 'optional string', | ||||
'credentialPHID' => 'optional string', | 'credentialPHID' => 'optional string', | ||||
'localPath' => 'optional string', | |||||
'svnSubpath' => 'optional string', | 'svnSubpath' => 'optional string', | ||||
'branchFilter' => 'optional list<string>', | 'branchFilter' => 'optional list<string>', | ||||
'closeCommitsFilter' => 'optional list<string>', | 'closeCommitsFilter' => 'optional list<string>', | ||||
'pullFrequency' => 'optional int', | 'pullFrequency' => 'optional int', | ||||
'defaultBranch' => 'optional string', | 'defaultBranch' => 'optional string', | ||||
'heraldEnabled' => 'optional bool, default = true', | 'heraldEnabled' => 'optional bool, default = true', | ||||
'autocloseEnabled' => 'optional bool, default = true', | 'autocloseEnabled' => 'optional bool, default = true', | ||||
'svnUUID' => 'optional string', | 'svnUUID' => 'optional string', | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
); | ); | ||||
if (empty($map[$vcs])) { | if (empty($map[$vcs])) { | ||||
throw new ConduitException('ERR-UNKNOWN-REPOSITORY-VCS'); | throw new ConduitException('ERR-UNKNOWN-REPOSITORY-VCS'); | ||||
} | } | ||||
$repository->setVersionControlSystem($map[$vcs]); | $repository->setVersionControlSystem($map[$vcs]); | ||||
$repository->setCredentialPHID($request->getValue('credentialPHID')); | $repository->setCredentialPHID($request->getValue('credentialPHID')); | ||||
$remote_uri = $request->getValue('uri'); | |||||
PhabricatorRepository::assertValidRemoteURI($remote_uri); | |||||
$details = array( | $details = array( | ||||
'encoding' => $request->getValue('encoding'), | 'encoding' => $request->getValue('encoding'), | ||||
'description' => $request->getValue('description'), | 'description' => $request->getValue('description'), | ||||
'tracking-enabled' => (bool)$request->getValue('tracking', true), | 'tracking-enabled' => (bool)$request->getValue('tracking', true), | ||||
'remote-uri' => $request->getValue('uri'), | 'remote-uri' => $remote_uri, | ||||
'local-path' => $request->getValue('localPath'), | |||||
'branch-filter' => array_fill_keys( | 'branch-filter' => array_fill_keys( | ||||
$request->getValue('branchFilter', array()), | $request->getValue('branchFilter', array()), | ||||
true), | true), | ||||
'close-commits-filter' => array_fill_keys( | 'close-commits-filter' => array_fill_keys( | ||||
$request->getValue('closeCommitsFilter', array()), | $request->getValue('closeCommitsFilter', array()), | ||||
true), | true), | ||||
'pull-frequency' => $request->getValue('pullFrequency'), | 'pull-frequency' => $request->getValue('pullFrequency'), | ||||
'default-branch' => $request->getValue('defaultBranch'), | 'default-branch' => $request->getValue('defaultBranch'), | ||||
Show All 20 Lines |