1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 15:21:03 +01:00

Pass branch information to local Conduit calls in Diffusion

Summary: Fixes T3697. Currently, we don't pass "branch" implicitly, so, e.g., when viewing a branch you don't get the right commit hash when looking up the README.

Test Plan: Viewed a non-`master` branch with a README, no fatal. Poked around and couldn't find anything suspicious.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3697

Differential Revision: https://secure.phabricator.com/D6734
This commit is contained in:
epriestley 2013-08-13 10:11:15 -07:00
parent b7387f314b
commit f11a4d5ef0
3 changed files with 11 additions and 3 deletions

View file

@ -90,7 +90,9 @@ abstract class ConduitAPI_diffusion_abstractquery_Method
final public function defineParamTypes() {
return $this->defineCustomParamTypes() +
array(
'callsign' => 'required string');
'callsign' => 'required string',
'branch' => 'optional string',
);
}
/**
* Subclasses should override this to specify custom param types.
@ -139,6 +141,7 @@ abstract class ConduitAPI_diffusion_abstractquery_Method
array(
'user' => $request->getUser(),
'callsign' => $request->getValue('callsign'),
'branch' => $request->getValue('branch'),
'path' => $request->getValue('path'),
'commit' => $request->getValue('commit'),
));

View file

@ -86,7 +86,7 @@ final class DiffusionBrowseController extends DiffusionController {
$readme = $this->callConduitWithDiffusionRequest(
'diffusion.readmequery',
array(
'paths' => $results->getPathDicts()
'paths' => $results->getPathDicts(),
));
if ($readme) {
$box = new PHUIBoxView();

View file

@ -53,8 +53,13 @@ abstract class DiffusionQuery extends PhabricatorQuery {
$repository = $drequest->getRepository();
$core_params = array(
'callsign' => $repository->getCallsign()
'callsign' => $repository->getCallsign(),
);
if ($drequest->getBranch() !== null) {
$core_params['branch'] = $drequest->getBranch();
}
$params = $params + $core_params;
return id(new ConduitCall(