@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Provide a history controller for Releeph branches

Summary: Ref T3663. Same as D6785, but for branches. No writes to this table yet.

Test Plan: Clicked "View History", got a blank but non-broken page.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3663

Differential Revision: https://secure.phabricator.com/D6787

+76 -4
+4
src/__phutil_library_map__.php
··· 1942 1942 'ReleephBranchCreateController' => 'applications/releeph/controller/branch/ReleephBranchCreateController.php', 1943 1943 'ReleephBranchEditController' => 'applications/releeph/controller/branch/ReleephBranchEditController.php', 1944 1944 'ReleephBranchEditor' => 'applications/releeph/editor/ReleephBranchEditor.php', 1945 + 'ReleephBranchHistoryController' => 'applications/releeph/controller/branch/ReleephBranchHistoryController.php', 1945 1946 'ReleephBranchNamePreviewController' => 'applications/releeph/controller/branch/ReleephBranchNamePreviewController.php', 1946 1947 'ReleephBranchPreviewView' => 'applications/releeph/view/branch/ReleephBranchPreviewView.php', 1947 1948 'ReleephBranchQuery' => 'applications/releeph/query/ReleephBranchQuery.php', 1948 1949 'ReleephBranchSearchEngine' => 'applications/releeph/query/ReleephBranchSearchEngine.php', 1949 1950 'ReleephBranchTemplate' => 'applications/releeph/view/branch/ReleephBranchTemplate.php', 1950 1951 'ReleephBranchTransaction' => 'applications/releeph/storage/ReleephBranchTransaction.php', 1952 + 'ReleephBranchTransactionQuery' => 'applications/releeph/query/ReleephBranchTransactionQuery.php', 1951 1953 'ReleephBranchViewController' => 'applications/releeph/controller/branch/ReleephBranchViewController.php', 1952 1954 'ReleephCommitFinder' => 'applications/releeph/commitfinder/ReleephCommitFinder.php', 1953 1955 'ReleephCommitFinderException' => 'applications/releeph/commitfinder/ReleephCommitFinderException.php', ··· 4122 4124 'ReleephBranchCreateController' => 'ReleephProjectController', 4123 4125 'ReleephBranchEditController' => 'ReleephProjectController', 4124 4126 'ReleephBranchEditor' => 'PhabricatorEditor', 4127 + 'ReleephBranchHistoryController' => 'ReleephProjectController', 4125 4128 'ReleephBranchNamePreviewController' => 'ReleephController', 4126 4129 'ReleephBranchPreviewView' => 'AphrontFormControl', 4127 4130 'ReleephBranchQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4128 4131 'ReleephBranchSearchEngine' => 'PhabricatorApplicationSearchEngine', 4129 4132 'ReleephBranchTransaction' => 'PhabricatorApplicationTransaction', 4133 + 'ReleephBranchTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 4130 4134 'ReleephBranchViewController' => 4131 4135 array( 4132 4136 0 => 'ReleephProjectController',
+4 -4
src/applications/releeph/application/PhabricatorApplicationReleeph.php
··· 51 51 '(?P<action>close|re-open)/(?P<branchID>[1-9]\d*)/' => 52 52 'ReleephBranchAccessController', 53 53 'preview/' => 'ReleephBranchNamePreviewController', 54 - 55 - // Left in, just in case the by-name stuff fails! 56 - '(?P<branchID>[^/]+)/' => 57 - 'ReleephBranchViewController', 54 + '(?P<branchID>[^/]+)/' => array( 55 + 'history/' => 'ReleephBranchHistoryController', 56 + '(?:query/(?P<queryKey>[^/]+)/)?' => 'ReleephBranchViewController', 57 + ), 58 58 ), 59 59 'request/' => array( 60 60 '(?P<requestID>[1-9]\d*)/' => 'ReleephRequestViewController',
+50
src/applications/releeph/controller/branch/ReleephBranchHistoryController.php
··· 1 + <?php 2 + 3 + final class ReleephBranchHistoryController extends ReleephProjectController { 4 + 5 + private $id; 6 + 7 + public function willProcessRequest(array $data) { 8 + $this->id = $data['branchID']; 9 + parent::willProcessRequest($data); 10 + } 11 + 12 + public function processRequest() { 13 + $request = $this->getRequest(); 14 + $viewer = $request->getUser(); 15 + 16 + $branch = id(new ReleephBranchQuery()) 17 + ->setViewer($viewer) 18 + ->withIDs(array($this->id)) 19 + ->executeOne(); 20 + if (!$branch) { 21 + return new Aphront404Response(); 22 + } 23 + 24 + $xactions = id(new ReleephBranchTransactionQuery()) 25 + ->setViewer($viewer) 26 + ->withObjectPHIDs(array($branch->getPHID())) 27 + ->execute(); 28 + 29 + $timeline = id(new PhabricatorApplicationTransactionView()) 30 + ->setUser($viewer) 31 + ->setObjectPHID($branch->getPHID()) 32 + ->setTransactions($xactions); 33 + 34 + $crumbs = $this->buildApplicationCrumbs(); 35 + $crumbs->addCrumb( 36 + id(new PhabricatorCrumbView()) 37 + ->setName(pht('History'))); 38 + 39 + return $this->buildApplicationPage( 40 + array( 41 + $crumbs, 42 + $timeline, 43 + ), 44 + array( 45 + 'title' => pht('Branch History'), 46 + 'device' => true, 47 + )); 48 + } 49 + 50 + }
+8
src/applications/releeph/controller/branch/ReleephBranchViewController.php
··· 123 123 $close_uri = $branch->getURI('close/'); 124 124 $reopen_uri = $branch->getURI('re-open/'); 125 125 126 + $id = $branch->getID(); 127 + $history_uri = $this->getApplicationURI("branch/{$id}/history/"); 128 + 126 129 $actions->addAction( 127 130 id(new PhabricatorActionView()) 128 131 ->setName(pht('Edit Branch')) ··· 151 154 ->setWorkflow(true)); 152 155 } 153 156 157 + $actions->addAction( 158 + id(new PhabricatorActionView()) 159 + ->setName(pht('View History')) 160 + ->setHref($history_uri) 161 + ->setIcon('transcript')); 154 162 155 163 $properties = id(new PhabricatorPropertyListView()) 156 164 ->setUser($viewer)
+10
src/applications/releeph/query/ReleephBranchTransactionQuery.php
··· 1 + <?php 2 + 3 + final class ReleephBranchTransactionQuery 4 + extends PhabricatorApplicationTransactionQuery { 5 + 6 + public function getTemplateApplicationTransaction() { 7 + return new ReleephBranchTransaction(); 8 + } 9 + 10 + }