Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14011870
D14941.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D14941.diff
View Options
diff --git a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
--- a/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
+++ b/src/applications/diffusion/application/PhabricatorDiffusionApplication.php
@@ -64,7 +64,7 @@
'(?:query/(?P<queryKey>[^/]+)/)?' => 'DiffusionPushLogListController',
'view/(?P<id>\d+)/' => 'DiffusionPushEventViewController',
),
- '(?P<callsign>[A-Z]+)/' => array(
+ '(?P<repositoryCallsign>(?P<callsign>[A-Z]+))/' => array(
'' => 'DiffusionRepositoryController',
'repository/(?P<dblob>.*)' => 'DiffusionRepositoryController',
diff --git a/src/applications/diffusion/controller/DiffusionBranchTableController.php b/src/applications/diffusion/controller/DiffusionBranchTableController.php
--- a/src/applications/diffusion/controller/DiffusionBranchTableController.php
+++ b/src/applications/diffusion/controller/DiffusionBranchTableController.php
@@ -6,15 +6,18 @@
return true;
}
- protected function processDiffusionRequest(AphrontRequest $request) {
- $drequest = $this->getDiffusionRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $response = $this->loadDiffusionContext();
+ if ($response) {
+ return $response;
+ }
+ $viewer = $this->getViewer();
+ $drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
- $pager = new PHUIPagerView();
- $pager->setURI($request->getRequestURI(), 'offset');
- $pager->setOffset($request->getInt('offset'));
+ $pager = id(new PHUIPagerView())
+ ->readFromRequest($request);
// TODO: Add support for branches that contain commit
$branches = $this->callConduitWithDiffusionRequest(
@@ -57,18 +60,20 @@
'branches' => true,
));
- return $this->buildApplicationPage(
- array(
- $crumbs,
- $content,
- $pager,
- ),
- array(
- 'title' => array(
+ $pager_box = $this->renderTablePagerBox($pager);
+
+ return $this->newPage()
+ ->setTitle(
+ array(
pht('Branches'),
$repository->getDisplayName(),
- ),
- ));
+ ))
+ ->setCrumbs($crumbs)
+ ->appendChild(
+ array(
+ $content,
+ $pager_box,
+ ));
}
}
diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php
--- a/src/applications/diffusion/controller/DiffusionController.php
+++ b/src/applications/diffusion/controller/DiffusionController.php
@@ -61,23 +61,16 @@
$identifier = (int)$request->getURIData('repositoryID');
}
- $blob = $request->getURIData('dblob');
- if (strlen($blob)) {
- $parsed = DiffusionRequest::parseRequestBlob($blob);
- } else {
- $parsed = array(
- 'commit' => $request->getURIData('commit'),
- 'path' => $request->getURIData('path'),
- 'line' => $request->getURIData('line'),
- 'branch' => $request->getURIData('branch'),
- 'lint' => $request->getStr('lint'),
- );
- }
-
$params = array(
'repository' => $identifier,
'user' => $viewer,
- ) + $parsed;
+ 'blob' => $request->getURIData('dblob'),
+ 'commit' => $request->getURIData('commit'),
+ 'path' => $request->getURIData('path'),
+ 'line' => $request->getURIData('line'),
+ 'branch' => $request->getURIData('branch'),
+ 'lint' => $request->getStr('lint'),
+ );
$drequest = DiffusionRequest::newFromDictionary($params);
@@ -286,4 +279,10 @@
->appendChild($body);
}
+ protected function renderTablePagerBox(PHUIPagerView $pager) {
+ return id(new PHUIBoxView())
+ ->addMargin(PHUI::MARGIN_LARGE)
+ ->appendChild($pager);
+ }
+
}
diff --git a/src/applications/diffusion/controller/DiffusionTagListController.php b/src/applications/diffusion/controller/DiffusionTagListController.php
--- a/src/applications/diffusion/controller/DiffusionTagListController.php
+++ b/src/applications/diffusion/controller/DiffusionTagListController.php
@@ -6,22 +6,25 @@
return true;
}
- protected function processDiffusionRequest(AphrontRequest $request) {
- $drequest = $this->getDiffusionRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $response = $this->loadDiffusionContext();
+ if ($response) {
+ return $response;
+ }
+ $viewer = $this->getViewer();
+ $drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
- $pager = new PHUIPagerView();
- $pager->setURI($request->getRequestURI(), 'offset');
- $pager->setOffset($request->getInt('offset'));
+ $pager = id(new PHUIPagerView())
+ ->readFromRequest($request);
$params = array(
'limit' => $pager->getPageSize() + 1,
'offset' => $pager->getOffset(),
);
- if ($drequest->getSymbolicCommit()) {
+ if (strlen($drequest->getSymbolicCommit())) {
$is_commit = true;
$params['commit'] = $drequest->getSymbolicCommit();
} else {
@@ -79,18 +82,20 @@
'commit' => $drequest->getSymbolicCommit(),
));
- return $this->buildApplicationPage(
- array(
- $crumbs,
- $content,
- $pager,
- ),
- array(
- 'title' => array(
+ $pager_box = $this->renderTablePagerBox($pager);
+
+ return $this->newPage()
+ ->setTitle(
+ array(
pht('Tags'),
$repository->getDisplayName(),
- ),
- ));
+ ))
+ ->setCrumbs($crumbs)
+ ->appendChild(
+ array(
+ $content,
+ $pager_box,
+ ));
}
}
diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php
--- a/src/applications/diffusion/request/DiffusionRequest.php
+++ b/src/applications/diffusion/request/DiffusionRequest.php
@@ -225,6 +225,12 @@
* @task new
*/
final private function initializeFromDictionary(array $data) {
+ $blob = idx($data, 'blob');
+ if (strlen($blob)) {
+ $blob = self::parseRequestBlob($blob, $this->supportsBranches());
+ $data = $blob + $data;
+ }
+
$this->path = idx($data, 'path');
$this->line = idx($data, 'line');
$this->initFromConduit = idx($data, 'initFromConduit', true);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 2, 5:32 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6747041
Default Alt Text
D14941.diff (6 KB)
Attached To
Mode
D14941: Modernize tag and branch controllers in Diffusion
Attached
Detach File
Event Timeline
Log In to Comment