Page MenuHomePhabricator

D17537.id42182.diff
No OneTemporary

D17537.id42182.diff

diff --git a/resources/sql/autopatches/20170322.reviewers.04.actor.sql b/resources/sql/autopatches/20170322.reviewers.04.actor.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170322.reviewers.04.actor.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_differential.differential_reviewer
+ ADD lastActorPHID VARBINARY(64);
diff --git a/src/applications/differential/storage/DifferentialReviewer.php b/src/applications/differential/storage/DifferentialReviewer.php
--- a/src/applications/differential/storage/DifferentialReviewer.php
+++ b/src/applications/differential/storage/DifferentialReviewer.php
@@ -8,6 +8,7 @@
protected $reviewerStatus;
protected $lastActionDiffPHID;
protected $lastCommentDiffPHID;
+ protected $lastActorPHID;
private $authority = array();
@@ -17,6 +18,7 @@
'reviewerStatus' => 'text64',
'lastActionDiffPHID' => 'phid?',
'lastCommentDiffPHID' => 'phid?',
+ 'lastActorPHID' => 'phid?',
),
self::CONFIG_KEY_SCHEMA => array(
'key_revision' => array(
diff --git a/src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php b/src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php
@@ -198,12 +198,17 @@
->setReviewerPHID($dst_phid);
}
+ $old_status = $reviewer->getReviewerStatus();
$reviewer->setReviewerStatus($status);
if ($diff_phid) {
$reviewer->setLastActionDiffPHID($diff_phid);
}
+ if ($old_status !== $status) {
+ $reviewer->setLastActorPHID($this->getActingAsPHID());
+ }
+
try {
$reviewer->save();
} catch (AphrontDuplicateKeyQueryException $ex) {

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 16, 1:40 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717669
Default Alt Text
D17537.id42182.diff (1 KB)

Event Timeline