@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.

Fix "arc diff --verbatim" when updating a revision

Summary: Fixes T4601. The "Differential Revision" field needs to be present in the "editable" version of the message so that `--verbatim` works correctly. Some day all of this might get rewritten to be a little easier to follow, maybe, but keep things working properly for now.

Test Plan: Used `arc diff`, `arc diff --edit`, `arc diff --verbatim`

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: aran, epriestley

Maniphest Tasks: T4601

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

+11 -5
+11 -5
src/applications/differential/customfield/DifferentialRevisionIDField.php
··· 3 3 final class DifferentialRevisionIDField 4 4 extends DifferentialCustomField { 5 5 6 + private $revisionID; 7 + 6 8 public function getFieldKey() { 7 9 return 'differential:revision-id'; 8 10 } ··· 29 31 return true; 30 32 } 31 33 32 - public function shouldAllowEditInCommitMessage() { 33 - return false; 34 - } 35 - 36 34 public function parseValueFromCommitMessage($value) { 37 35 return self::parseRevisionIDFromURI($value); 38 36 } 39 37 40 38 public function renderCommitMessageValue(array $handles) { 41 - return PhabricatorEnv::getProductionURI('/D'.$this->getObject()->getID()); 39 + $id = coalesce($this->revisionID, $this->getObject()->getID()); 40 + if (!$id) { 41 + return null; 42 + } 43 + return PhabricatorEnv::getProductionURI('/D'.$id); 44 + } 45 + 46 + public function readValueFromCommitMessage($value) { 47 + $this->revisionID = $value; 42 48 } 43 49 44 50 private static function parseRevisionIDFromURI($uri) {