Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14840912
D8716.id20668.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
D8716.id20668.diff
View Options
diff --git a/src/workflow/ArcanistAmendWorkflow.php b/src/workflow/ArcanistAmendWorkflow.php
--- a/src/workflow/ArcanistAmendWorkflow.php
+++ b/src/workflow/ArcanistAmendWorkflow.php
@@ -94,7 +94,6 @@
$in_working_copy = $repository_api->loadWorkingCopyDifferentialRevisions(
$this->getConduit(),
array(
- 'authors' => array($this->getUserPHID()),
'status' => 'status-any',
));
$in_working_copy = ipull($in_working_copy, null, 'id');
@@ -113,6 +112,24 @@
throw new ArcanistUsageException($message);
} else {
$revision_id = key($in_working_copy);
+ $revision = $in_working_copy[$revision_id];
+ if ($revision['authorPHID'] != $this->getUserPHID()) {
+ $other_author = $this->getConduit()->callMethodSynchronous(
+ 'user.query',
+ array(
+ 'phids' => array($revision['authorPHID']),
+ ));
+ $other_author = ipull($other_author, 'userName', 'phid');
+ $other_author = $other_author[$revision['authorPHID']];
+ $rev_title = $revision['title'];
+ $ok = phutil_console_confirm(
+ "You are amending the revision 'D{$revision_id}: {$rev_title}' ".
+ "but you are not the author. Amend this revision by ".
+ "{$other_author}?");
+ if (!$ok) {
+ throw new ArcanistUserAbortException();
+ }
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 2, 10:50 AM (2 h, 6 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7083386
Default Alt Text
D8716.id20668.diff (1 KB)
Attached To
Mode
D8716: Arcanist - allow amending revisions by other authors in the working copy
Attached
Detach File
Event Timeline
Log In to Comment