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

Always mark revisions as "updated" when users comment on them

Summary: See T773 and the explanatory inline comment.

Test Plan: Made no-action comments and comments that did something (reject, plan
changes) to revisions. Saw them always jump to the top of the action list.

Reviewers: jungejason, simpkins, btrahan

Reviewed By: jungejason

CC: aran, jungejason

Maniphest Tasks: T773

Differential Revision: https://secure.phabricator.com/D1386
This commit is contained in:
epriestley 2012-01-12 19:22:09 -08:00
parent a88e132179
commit 04eb1f98e2

View file

@ -144,8 +144,7 @@ class DifferentialCommentEditor {
} }
$revision $revision
->setStatus(ArcanistDifferentialRevisionStatus::ABANDONED) ->setStatus(ArcanistDifferentialRevisionStatus::ABANDONED);
->save();
break; break;
case DifferentialAction::ACTION_ACCEPT: case DifferentialAction::ACTION_ACCEPT:
@ -161,8 +160,7 @@ class DifferentialCommentEditor {
} }
$revision $revision
->setStatus(ArcanistDifferentialRevisionStatus::ACCEPTED) ->setStatus(ArcanistDifferentialRevisionStatus::ACCEPTED);
->save();
if (!isset($reviewer_phids[$actor_phid])) { if (!isset($reviewer_phids[$actor_phid])) {
DifferentialRevisionEditor::alterReviewers( DifferentialRevisionEditor::alterReviewers(
@ -187,8 +185,7 @@ class DifferentialCommentEditor {
} }
$revision $revision
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) ->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
->save();
break; break;
case DifferentialAction::ACTION_REJECT: case DifferentialAction::ACTION_REJECT:
@ -214,8 +211,7 @@ class DifferentialCommentEditor {
} }
$revision $revision
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVISION) ->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVISION);
->save();
break; break;
case DifferentialAction::ACTION_RETHINK: case DifferentialAction::ACTION_RETHINK:
@ -232,8 +228,7 @@ class DifferentialCommentEditor {
} }
$revision $revision
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVISION) ->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVISION);
->save();
break; break;
case DifferentialAction::ACTION_RECLAIM: case DifferentialAction::ACTION_RECLAIM:
@ -246,14 +241,12 @@ class DifferentialCommentEditor {
break; break;
} }
$revision $revision
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) ->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
->save();
break; break;
case DifferentialAction::ACTION_COMMIT: case DifferentialAction::ACTION_COMMIT:
$revision $revision
->setStatus(ArcanistDifferentialRevisionStatus::COMMITTED) ->setStatus(ArcanistDifferentialRevisionStatus::COMMITTED);
->save();
break; break;
case DifferentialAction::ACTION_ADDREVIEWERS: case DifferentialAction::ACTION_ADDREVIEWERS:
@ -316,6 +309,12 @@ class DifferentialCommentEditor {
throw new Exception('Unsupported action.'); throw new Exception('Unsupported action.');
} }
// Always save the revision (even if we didn't actually change any of its
// properties) so that it jumps to the top of the revision list when sorted
// by "updated". Notably, this allows "ping" comments to push it to the
// top of the action list.
$revision->save();
if ($this->addCC) { if ($this->addCC) {
DifferentialRevisionEditor::addCC( DifferentialRevisionEditor::addCC(
$revision, $revision,