diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 6209a98ac5..2221536517 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1942,12 +1942,14 @@ phutil_register_library_map(array( 'ReleephBranchCreateController' => 'applications/releeph/controller/branch/ReleephBranchCreateController.php', 'ReleephBranchEditController' => 'applications/releeph/controller/branch/ReleephBranchEditController.php', 'ReleephBranchEditor' => 'applications/releeph/editor/ReleephBranchEditor.php', + 'ReleephBranchHistoryController' => 'applications/releeph/controller/branch/ReleephBranchHistoryController.php', 'ReleephBranchNamePreviewController' => 'applications/releeph/controller/branch/ReleephBranchNamePreviewController.php', 'ReleephBranchPreviewView' => 'applications/releeph/view/branch/ReleephBranchPreviewView.php', 'ReleephBranchQuery' => 'applications/releeph/query/ReleephBranchQuery.php', 'ReleephBranchSearchEngine' => 'applications/releeph/query/ReleephBranchSearchEngine.php', 'ReleephBranchTemplate' => 'applications/releeph/view/branch/ReleephBranchTemplate.php', 'ReleephBranchTransaction' => 'applications/releeph/storage/ReleephBranchTransaction.php', + 'ReleephBranchTransactionQuery' => 'applications/releeph/query/ReleephBranchTransactionQuery.php', 'ReleephBranchViewController' => 'applications/releeph/controller/branch/ReleephBranchViewController.php', 'ReleephCommitFinder' => 'applications/releeph/commitfinder/ReleephCommitFinder.php', 'ReleephCommitFinderException' => 'applications/releeph/commitfinder/ReleephCommitFinderException.php', @@ -4122,11 +4124,13 @@ phutil_register_library_map(array( 'ReleephBranchCreateController' => 'ReleephProjectController', 'ReleephBranchEditController' => 'ReleephProjectController', 'ReleephBranchEditor' => 'PhabricatorEditor', + 'ReleephBranchHistoryController' => 'ReleephProjectController', 'ReleephBranchNamePreviewController' => 'ReleephController', 'ReleephBranchPreviewView' => 'AphrontFormControl', 'ReleephBranchQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'ReleephBranchSearchEngine' => 'PhabricatorApplicationSearchEngine', 'ReleephBranchTransaction' => 'PhabricatorApplicationTransaction', + 'ReleephBranchTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'ReleephBranchViewController' => array( 0 => 'ReleephProjectController', diff --git a/src/applications/releeph/application/PhabricatorApplicationReleeph.php b/src/applications/releeph/application/PhabricatorApplicationReleeph.php index 593ec88108..46fcd86f37 100644 --- a/src/applications/releeph/application/PhabricatorApplicationReleeph.php +++ b/src/applications/releeph/application/PhabricatorApplicationReleeph.php @@ -51,10 +51,10 @@ final class PhabricatorApplicationReleeph extends PhabricatorApplication { '(?Pclose|re-open)/(?P[1-9]\d*)/' => 'ReleephBranchAccessController', 'preview/' => 'ReleephBranchNamePreviewController', - - // Left in, just in case the by-name stuff fails! - '(?P[^/]+)/' => - 'ReleephBranchViewController', + '(?P[^/]+)/' => array( + 'history/' => 'ReleephBranchHistoryController', + '(?:query/(?P[^/]+)/)?' => 'ReleephBranchViewController', + ), ), 'request/' => array( '(?P[1-9]\d*)/' => 'ReleephRequestViewController', diff --git a/src/applications/releeph/controller/branch/ReleephBranchHistoryController.php b/src/applications/releeph/controller/branch/ReleephBranchHistoryController.php new file mode 100644 index 0000000000..7e1314a03e --- /dev/null +++ b/src/applications/releeph/controller/branch/ReleephBranchHistoryController.php @@ -0,0 +1,50 @@ +id = $data['branchID']; + parent::willProcessRequest($data); + } + + public function processRequest() { + $request = $this->getRequest(); + $viewer = $request->getUser(); + + $branch = id(new ReleephBranchQuery()) + ->setViewer($viewer) + ->withIDs(array($this->id)) + ->executeOne(); + if (!$branch) { + return new Aphront404Response(); + } + + $xactions = id(new ReleephBranchTransactionQuery()) + ->setViewer($viewer) + ->withObjectPHIDs(array($branch->getPHID())) + ->execute(); + + $timeline = id(new PhabricatorApplicationTransactionView()) + ->setUser($viewer) + ->setObjectPHID($branch->getPHID()) + ->setTransactions($xactions); + + $crumbs = $this->buildApplicationCrumbs(); + $crumbs->addCrumb( + id(new PhabricatorCrumbView()) + ->setName(pht('History'))); + + return $this->buildApplicationPage( + array( + $crumbs, + $timeline, + ), + array( + 'title' => pht('Branch History'), + 'device' => true, + )); + } + +} diff --git a/src/applications/releeph/controller/branch/ReleephBranchViewController.php b/src/applications/releeph/controller/branch/ReleephBranchViewController.php index a82795a19a..6297138b9e 100644 --- a/src/applications/releeph/controller/branch/ReleephBranchViewController.php +++ b/src/applications/releeph/controller/branch/ReleephBranchViewController.php @@ -123,6 +123,9 @@ final class ReleephBranchViewController extends ReleephProjectController $close_uri = $branch->getURI('close/'); $reopen_uri = $branch->getURI('re-open/'); + $id = $branch->getID(); + $history_uri = $this->getApplicationURI("branch/{$id}/history/"); + $actions->addAction( id(new PhabricatorActionView()) ->setName(pht('Edit Branch')) @@ -151,6 +154,11 @@ final class ReleephBranchViewController extends ReleephProjectController ->setWorkflow(true)); } + $actions->addAction( + id(new PhabricatorActionView()) + ->setName(pht('View History')) + ->setHref($history_uri) + ->setIcon('transcript')); $properties = id(new PhabricatorPropertyListView()) ->setUser($viewer) diff --git a/src/applications/releeph/query/ReleephBranchTransactionQuery.php b/src/applications/releeph/query/ReleephBranchTransactionQuery.php new file mode 100644 index 0000000000..3e88259b25 --- /dev/null +++ b/src/applications/releeph/query/ReleephBranchTransactionQuery.php @@ -0,0 +1,10 @@ +