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

Show verb of closed diff based on backing vcs, not local vcs

Summary:
When choosing a verb to show with a closed differential revision, choose the
verb based on the upstream vcs, not the vcs used to create the diff, since these
are not the same thing. I also updated the documentation for the next step for
an accepted diff for the case where the local vcs and backing vcs aren't the
same (since arc land doesn't work for those).

Test Plan:
Loaded a committed diff and an accepted diff from fbcode and www to check that
they show the correct thing.

Reviewers: jungejason, epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Maniphest Tasks: T1118

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

+22 -12
+17 -12
src/applications/differential/field/specification/revisionstatus/DifferentialRevisionStatusFieldSpecification.php
··· 33 33 34 34 $status = $revision->getStatus(); 35 35 $info = null; 36 - $vcs = $diff->getSourceControlSystem(); 36 + $local_vcs = $diff->getSourceControlSystem(); 37 + $backing_vcs = $diff->getBackingVersionControlSystem(); 37 38 38 39 if ($status == ArcanistDifferentialRevisionStatus::ACCEPTED) { 39 - switch ($vcs) { 40 - case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 41 - $next_step = '<tt>hg push</tt>'; 42 - break; 43 - case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 44 - $next_step = '<tt>arc land</tt>'; 45 - break; 46 - case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 47 - $next_step = '<tt>arc commit</tt>'; 48 - break; 40 + if ($local_vcs == $backing_vcs) { 41 + switch ($local_vcs) { 42 + case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 43 + $next_step = '<tt>hg push</tt>'; 44 + break; 45 + case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 46 + $next_step = '<tt>arc land</tt>'; 47 + break; 48 + case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 49 + $next_step = '<tt>arc commit</tt>'; 50 + break; 51 + } 52 + } else { 53 + $next_step = '<tt>arc amend</tt>'; 49 54 } 50 55 if ($next_step) { 51 56 $info = ' &middot; Next step: '.$next_step; ··· 53 58 54 59 } else if ($status == ArcanistDifferentialRevisionStatus::CLOSED) { 55 60 $committed = $revision->getDateCommitted(); 56 - switch ($vcs) { 61 + switch ($backing_vcs) { 57 62 case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 58 63 case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 59 64 $verb = 'Pushed';
+5
src/applications/differential/storage/diff/DifferentialDiff.php
··· 85 85 $this->getArcanistProjectPHID()); 86 86 } 87 87 88 + public function getBackingVersionControlSystem() { 89 + $repository = $this->loadArcanistProject()->loadRepository(); 90 + return $repository->getVersionControlSystem(); 91 + } 92 + 88 93 public function save() { 89 94 // TODO: sort out transactions 90 95 // $this->openTransaction();