Page MenuHomePhabricator

D8526.id20230.diff
No OneTemporary

D8526.id20230.diff

diff --git a/src/applications/differential/customfield/DifferentialRevisionIDField.php b/src/applications/differential/customfield/DifferentialRevisionIDField.php
--- a/src/applications/differential/customfield/DifferentialRevisionIDField.php
+++ b/src/applications/differential/customfield/DifferentialRevisionIDField.php
@@ -3,6 +3,8 @@
final class DifferentialRevisionIDField
extends DifferentialCustomField {
+ private $revisionID;
+
public function getFieldKey() {
return 'differential:revision-id';
}
@@ -29,16 +31,20 @@
return true;
}
- public function shouldAllowEditInCommitMessage() {
- return false;
- }
-
public function parseValueFromCommitMessage($value) {
return self::parseRevisionIDFromURI($value);
}
public function renderCommitMessageValue(array $handles) {
- return PhabricatorEnv::getProductionURI('/D'.$this->getObject()->getID());
+ $id = coalesce($this->revisionID, $this->getObject()->getID());
+ if (!$id) {
+ return null;
+ }
+ return PhabricatorEnv::getProductionURI('/D'.$id);
+ }
+
+ public function readValueFromCommitMessage($value) {
+ $this->revisionID = $value;
}
private static function parseRevisionIDFromURI($uri) {

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 7:44 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223236
Default Alt Text
D8526.id20230.diff (1 KB)

Event Timeline