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

[Phabricator] track Mercurial bookmarks for differential diffs

Summary:
This adds all the changes necessary to track the active Mercurial
bookmark for differential diffs. We render both branch and bookmark
information in the branch field of the Differential revison view, as
seen in
https://secure.phabricator.com/file/data/kzpmu3evfkukxdjyxrfz/PHID-FILE-eqorsqupxvwirqi2s5lo/bookmark_differential.jpg

The Arcanist half of this is https://secure.phabricator.com/D2896

Test Plan:
Mostly D2896.

Additionally, loaded a diff created with a bookmark, as per the link in the summary.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1331

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

+19 -1
+3
resources/sql/patches/differentialbookmarks.sql
··· 1 + ALTER TABLE `{$NAMESPACE}_differential`.`differential_diff` 2 + ADD `bookmark` VARCHAR(255) COLLATE utf8_general_ci DEFAULT NULL 3 + AFTER `branch`;
+2
src/applications/conduit/method/differential/ConduitAPI_differential_creatediff_Method.php
··· 31 31 'sourceMachine' => 'required string', 32 32 'sourcePath' => 'required string', 33 33 'branch' => 'required string', 34 + 'bookmark' => 'optional string', 34 35 'sourceControlSystem' => 'required enum<svn, git>', 35 36 'sourceControlPath' => 'required string', 36 37 'sourceControlBaseRevision' => 'required string', ··· 70 71 $diff->setBranch($request->getValue('branch')); 71 72 $diff->setCreationMethod($request->getValue('creationMethod')); 72 73 $diff->setAuthorPHID($request->getValue('authorPHID')); 74 + $diff->setBookmark($request->getValue('bookmark')); 73 75 74 76 $parent_id = $request->getValue('parentRevisionID'); 75 77 if ($parent_id) {
+8 -1
src/applications/differential/field/specification/DifferentialBranchFieldSpecification.php
··· 31 31 $diff = $this->getDiff(); 32 32 33 33 $branch = $diff->getBranch(); 34 - if ($branch == '') { 34 + $bookmark = $diff->getBookmark(); 35 + $has_branch = ($branch != ''); 36 + $has_bookmark = ($bookmark != ''); 37 + if ($has_branch && $has_bookmark) { 38 + $branch = "{$bookmark} bookmark on {$branch} branch"; 39 + } else if ($has_bookmark) { 40 + $branch = "{$bookmark} bookmark"; 41 + } else if (!$has_branch) { 35 42 return null; 36 43 } 37 44
+2
src/applications/differential/storage/DifferentialDiff.php
··· 34 34 protected $lineCount; 35 35 36 36 protected $branch; 37 + protected $bookmark; 37 38 38 39 protected $parentRevisionID; 39 40 protected $arcanistProjectPHID; ··· 257 258 'sourceControlPath' => $this->getSourceControlPath(), 258 259 'sourceControlSystem' => $this->getSourceControlSystem(), 259 260 'branch' => $this->getBranch(), 261 + 'bookmark' => $this->getBookmark(), 260 262 'creationMethod' => $this->getCreationMethod(), 261 263 'description' => $this->getDescription(), 262 264 'unitStatus' => $this->getUnitStatus(),
+4
src/infrastructure/setup/sql/PhabricatorBuiltinPatchList.php
··· 895 895 'type' => 'sql', 896 896 'name' => $this->getPatchPath('usertranslation.sql'), 897 897 ), 898 + 'differentialbookmarks.sql' => array( 899 + 'type' => 'sql', 900 + 'name' => $this->getPatchPath('differentialbookmarks.sql'), 901 + ), 898 902 ); 899 903 } 900 904