Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14754275
D17175.id41307.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D17175.id41307.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -624,6 +624,8 @@
'DiffusionCommitDiffContentRemovedHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffContentRemovedHeraldField.php',
'DiffusionCommitDiffEnormousHeraldField' => 'applications/diffusion/herald/DiffusionCommitDiffEnormousHeraldField.php',
'DiffusionCommitEditController' => 'applications/diffusion/controller/DiffusionCommitEditController.php',
+ 'DiffusionCommitEditEngine' => 'applications/diffusion/editor/DiffusionCommitEditEngine.php',
+ 'DiffusionCommitEditProController' => 'applications/diffusion/controller/DiffusionCommitEditProController.php',
'DiffusionCommitFulltextEngine' => 'applications/repository/search/DiffusionCommitFulltextEngine.php',
'DiffusionCommitHasRevisionEdgeType' => 'applications/diffusion/edge/DiffusionCommitHasRevisionEdgeType.php',
'DiffusionCommitHasRevisionRelationship' => 'applications/diffusion/relationships/DiffusionCommitHasRevisionRelationship.php',
@@ -5316,6 +5318,8 @@
'DiffusionCommitDiffContentRemovedHeraldField' => 'DiffusionCommitHeraldField',
'DiffusionCommitDiffEnormousHeraldField' => 'DiffusionCommitHeraldField',
'DiffusionCommitEditController' => 'DiffusionController',
+ 'DiffusionCommitEditEngine' => 'PhabricatorEditEngine',
+ 'DiffusionCommitEditProController' => 'DiffusionController',
'DiffusionCommitFulltextEngine' => 'PhabricatorFulltextEngine',
'DiffusionCommitHasRevisionEdgeType' => 'PhabricatorEdgeType',
'DiffusionCommitHasRevisionRelationship' => 'DiffusionCommitRelationship',
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
@@ -131,6 +131,11 @@
'symbol/(?P<name>[^/]+)/' => 'DiffusionSymbolController',
'external/' => 'DiffusionExternalController',
'lint/' => 'DiffusionLintController',
+
+ 'commit/' => array(
+ $this->getEditRoutePattern('edit/') =>
+ 'DiffusionCommitEditProController',
+ ),
),
);
}
diff --git a/src/applications/diffusion/controller/DiffusionCommitEditProController.php b/src/applications/diffusion/controller/DiffusionCommitEditProController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/diffusion/controller/DiffusionCommitEditProController.php
@@ -0,0 +1,12 @@
+<?php
+
+final class DiffusionCommitEditProController
+ extends DiffusionController {
+
+ public function handleRequest(AphrontRequest $request) {
+ return id(new DiffusionCommitEditEngine())
+ ->setController($this)
+ ->buildResponse();
+ }
+
+}
diff --git a/src/applications/diffusion/editor/DiffusionCommitEditEngine.php b/src/applications/diffusion/editor/DiffusionCommitEditEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/diffusion/editor/DiffusionCommitEditEngine.php
@@ -0,0 +1,70 @@
+<?php
+
+final class DiffusionCommitEditEngine
+ extends PhabricatorEditEngine {
+
+ const ENGINECONST = 'diffusion.commit';
+
+ public function isEngineConfigurable() {
+ return false;
+ }
+
+ public function getEngineName() {
+ return pht('Commits');
+ }
+
+ public function getSummaryHeader() {
+ return pht('Edit Commits');
+ }
+
+ public function getSummaryText() {
+ return pht('Edit commits.');
+ }
+
+ public function getEngineApplicationClass() {
+ return 'PhabricatorDiffusionApplication';
+ }
+
+ protected function newEditableObject() {
+ throw new PhutilMethodNotImplementedException();
+ }
+
+ protected function newObjectQuery() {
+ return new DiffusionCommitQuery();
+ }
+
+ protected function getObjectCreateTitleText($object) {
+ return pht('Create Commit');
+ }
+
+ protected function getObjectCreateShortText() {
+ return pht('Create Commit');
+ }
+
+ protected function getObjectEditTitleText($object) {
+ return pht('Edit Commit: %s', $object->getDisplayName());
+ }
+
+ protected function getObjectEditShortText($object) {
+ return $object->getDisplayName();
+ }
+
+ protected function getObjectName() {
+ return pht('Commit');
+ }
+
+ protected function getObjectViewURI($object) {
+ return $object->getURI();
+ }
+
+ protected function getCreateNewObjectPolicy() {
+ return PhabricatorPolicies::POLICY_NOONE;
+ }
+
+ protected function buildCustomEditFields($object) {
+ $viewer = $this->getViewer();
+
+ return array();
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 3:29 PM (10 h, 25 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7030850
Default Alt Text
D17175.id41307.diff (4 KB)
Attached To
Mode
D17175: Bring very basic EditEngine support to commits
Attached
Detach File
Event Timeline
Log In to Comment