Page MenuHomePhabricator

D17537.diff
No OneTemporary

D17537.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
Fri, Oct 25, 9:25 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717669
Default Alt Text
D17537.diff (1 KB)

Event Timeline