Page MenuHomePhabricator

D8716.id20668.diff
No OneTemporary

D8716.id20668.diff

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

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)

Event Timeline