Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15418759
D20545.id49018.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20545.id49018.diff
View Options
diff --git a/src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php b/src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionUpdateTransaction.php
@@ -10,6 +10,26 @@
return $object->getActiveDiffPHID();
}
+ public function generateNewValue($object, $value) {
+ // See T13290. If we're updating the revision in response to a commit but
+ // the revision is already closed, return the old value so we no-op this
+ // transaction. We don't want to attach more than one commit-diff to a
+ // revision.
+
+ // Although we can try to bail out earlier so we don't generate this
+ // transaction in the first place, we may race another worker and end up
+ // trying to apply it anyway. Here, we have a lock on the object and can
+ // be certain about the object state.
+
+ if ($this->isCommitUpdate()) {
+ if ($object->isClosed()) {
+ return $this->generateOldValue($object);
+ }
+ }
+
+ return $value;
+ }
+
public function applyInternalEffects($object, $value) {
$should_review = $this->shouldRequestReviewAfterUpdate($object);
if ($should_review) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 22, 1:17 AM (1 d, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712855
Default Alt Text
D20545.id49018.diff (1 KB)
Attached To
Mode
D20545: Drop the "update revision with commit diff" transaction if the revision is already closed
Attached
Detach File
Event Timeline
Log In to Comment