From 9292cfd6a3ab823daf816e13fde97c5dcc535732 Mon Sep 17 00:00:00 2001 From: Marek Sapota Date: Tue, 13 Dec 2011 13:39:38 -0800 Subject: [PATCH] Recognise better who committed a revision. Test Plan: Commit as not the author and see what shows up. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley, mareksapota, zeeg Differential Revision: 1195 --- ...habricatorRepositoryCommitMessageParserWorker.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/applications/repository/worker/commitmessageparser/base/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/base/PhabricatorRepositoryCommitMessageParserWorker.php index cb01c48b48..18dc4d5817 100644 --- a/src/applications/repository/worker/commitmessageparser/base/PhabricatorRepositoryCommitMessageParserWorker.php +++ b/src/applications/repository/worker/commitmessageparser/base/PhabricatorRepositoryCommitMessageParserWorker.php @@ -96,11 +96,19 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker $commit->getPHID()); if ($revision->getStatus() != DifferentialRevisionStatus::COMMITTED) { + $committer = null; + $message = null; + if ($commit->getDetail('authorPHID')) { + $committer = $commit->getDetail('authorPHID'); + } else { + $committer = $revision->getAuthorPHID(); + $message = 'Change committed by '.$commit->getAuthorName().'.'; + } $editor = new DifferentialCommentEditor( $revision, - $revision->getAuthorPHID(), + $committer, DifferentialAction::ACTION_COMMIT); - $editor->save(); + $editor->setMessage($message)->save(); } } }