From f1de90d7ef4a43c7d3ee9c45907db2ea2e8d8f42 Mon Sep 17 00:00:00 2001 From: Marek Sapota Date: Tue, 1 Nov 2011 11:44:20 -0700 Subject: [PATCH] Mark person that actually runs `arc commit` as committer instead of the author. Summary: `arc commit` and `arc mark-committed` would only add comments committed this revision, since now everyone can run this commands it makes more sense to show the actual committer instead of the author. Test Plan: Commit (or mark committed) not your revision, Phabricator should add committed this revision comment instead of committed this revision. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: 1067 --- .../ConduitAPI_differential_markcommitted_Method.php | 2 +- .../differential/editor/comment/DifferentialCommentEditor.php | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/applications/conduit/method/differential/markcommitted/ConduitAPI_differential_markcommitted_Method.php b/src/applications/conduit/method/differential/markcommitted/ConduitAPI_differential_markcommitted_Method.php index d06253b663..a8277739e4 100644 --- a/src/applications/conduit/method/differential/markcommitted/ConduitAPI_differential_markcommitted_Method.php +++ b/src/applications/conduit/method/differential/markcommitted/ConduitAPI_differential_markcommitted_Method.php @@ -62,7 +62,7 @@ class ConduitAPI_differential_markcommitted_Method extends ConduitAPIMethod { $editor = new DifferentialCommentEditor( $revision, - $revision->getAuthorPHID(), + $request->getUser()->getPHID(), DifferentialAction::ACTION_COMMIT); $editor->save(); diff --git a/src/applications/differential/editor/comment/DifferentialCommentEditor.php b/src/applications/differential/editor/comment/DifferentialCommentEditor.php index 2610f05f27..b242d1e6a7 100644 --- a/src/applications/differential/editor/comment/DifferentialCommentEditor.php +++ b/src/applications/differential/editor/comment/DifferentialCommentEditor.php @@ -240,9 +240,6 @@ class DifferentialCommentEditor { break; case DifferentialAction::ACTION_COMMIT: - if (!$actor_is_author) { - throw new Exception('You can not commit a revision you do not own.'); - } $revision ->setStatus(DifferentialRevisionStatus::COMMITTED) ->save();