Remove any-author flag from 'arc which' make any-author be the default behavior. Annotate revision with the owners username.
Details
Apply a patch that you don't own (arc patch Dxxx) run 'arc which' verify that:
- You see the revision
- You see the original authors username next to the revision (owned by sjobs) etc.
Diff Detail
- Repository
- rARC Arcanist
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
This suffers from the N+1 Query Problem. Although it's not a big deal, it's easy to fix. A cleaner approach (which makes a single service call in the worst case, and thus performs better) would look like this:
$other_author_phids = array(); foreach ($revisions as $revision) { if ($revision['authorPHID'] != $this->getUserPHID()) { $other_author_phids[] = $revision['authorPHID']; } } $other_authors = array(); if ($other_author_phids) { $other_authors = $conduit->callMethodSynchronous(...); $other_authors = ipull($other_authors, 'userName', 'phid'); }
This also avoids the service call entirely in the common case.
In the output, let's not show anything special if the user is the author, and preface the revisions if they aren't to make it easier to see the author annotation. With the current approach, it can get lost at the end of a long line. For example, if the user owns D123 but not D124, output something like this:
D123 Add feature D124 (alincoln) Add other feature
src/workflow/ArcanistWhichWorkflow.php | ||
---|---|---|
140–141 | You can just omit this parameter. |
I didn't see an easy way around having 2 foreach loops now... but, I might just be tired.
(I made some very minor formatting changes in the pull, and added a missing "\n" that I caught.)