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

Add support for bookmarks in Phabricator emails.

Summary: Right now emails don't include bookmark info (wasn't added in D2897). Lets include it so it's consistent with the web UI.

Test Plan: Inspected code, made sure it matched web UI code. Verified that web UI with these changes was consistent with rendering before refactoring.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

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

+15 -11
+15 -11
src/applications/differential/field/specification/DifferentialBranchFieldSpecification.php
··· 11 11 return 'Branch:'; 12 12 } 13 13 14 - public function renderValueForRevisionView() { 15 - $diff = $this->getManualDiff(); 16 - 14 + private function getBranchOrBookmarkDescription(DifferentialDiff $diff) { 17 15 $branch = $diff->getBranch(); 18 16 $bookmark = $diff->getBookmark(); 19 17 $has_branch = ($branch != ''); 20 18 $has_bookmark = ($bookmark != ''); 21 19 if ($has_branch && $has_bookmark) { 22 - $branch = "{$bookmark} bookmark on {$branch} branch"; 20 + return "{$bookmark} bookmark on {$branch} branch"; 23 21 } else if ($has_bookmark) { 24 - $branch = "{$bookmark} bookmark"; 25 - } else if (!$has_branch) { 26 - return null; 22 + return "{$bookmark} bookmark"; 23 + } else if ($has_branch) { 24 + return $branch; 27 25 } 26 + return null; 27 + } 28 28 29 - return $branch; 29 + public function renderValueForRevisionView() { 30 + $diff = $this->getManualDiff(); 31 + return $this->getBranchOrBookmarkDescription($diff); 30 32 } 31 33 32 34 public function renderValueForMail($phase) { ··· 39 41 40 42 $diff = $this->getRevision()->loadActiveDiff(); 41 43 if ($diff) { 42 - $branch = $diff->getBranch(); 43 - if ($branch) { 44 - return "BRANCH\n $branch"; 44 + $description = $this->getBranchOrBookmarkDescription($diff); 45 + if ($description) { 46 + return "BRANCH\n {$description}"; 45 47 } 46 48 } 49 + 50 + return null; 47 51 } 48 52 49 53 public function didWriteRevision(DifferentialRevisionEditor $editor) {