1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +01:00

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
This commit is contained in:
Nick Harper 2012-05-01 11:30:02 -07:00
parent b916722151
commit 56529f88e0
2 changed files with 22 additions and 12 deletions

View file

@ -33,10 +33,12 @@ final class DifferentialRevisionStatusFieldSpecification
$status = $revision->getStatus();
$info = null;
$vcs = $diff->getSourceControlSystem();
$local_vcs = $diff->getSourceControlSystem();
$backing_vcs = $diff->getBackingVersionControlSystem();
if ($status == ArcanistDifferentialRevisionStatus::ACCEPTED) {
switch ($vcs) {
if ($local_vcs == $backing_vcs) {
switch ($local_vcs) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
$next_step = '<tt>hg push</tt>';
break;
@ -47,13 +49,16 @@ final class DifferentialRevisionStatusFieldSpecification
$next_step = '<tt>arc commit</tt>';
break;
}
} else {
$next_step = '<tt>arc amend</tt>';
}
if ($next_step) {
$info = ' &middot; Next step: '.$next_step;
}
} else if ($status == ArcanistDifferentialRevisionStatus::CLOSED) {
$committed = $revision->getDateCommitted();
switch ($vcs) {
switch ($backing_vcs) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
$verb = 'Pushed';

View file

@ -85,6 +85,11 @@ final class DifferentialDiff extends DifferentialDAO {
$this->getArcanistProjectPHID());
}
public function getBackingVersionControlSystem() {
$repository = $this->loadArcanistProject()->loadRepository();
return $repository->getVersionControlSystem();
}
public function save() {
// TODO: sort out transactions
// $this->openTransaction();