@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix some issues with the "Explain Why" dialog

Summary:
Ref T11051. This is still not as clear as it should be, but is at least working as intended now.

I believe this part of the code just never worked. The test plan on D10489 didn't specifically cover it.

Test Plan:
Did this sort of thing in a repository:

```
$ git checkout -b featurex
$ echo x >> y
$ git commit -am wip
$ arc diff
```

Then I simulated just pushing it (this flow is a little more involved than necessary):

```
$ arc land --hold
$ git commit --amend
$ # remove all metadata -- particularly, "Differential Revision"!
$ git push HEAD:master
```

I got a not-great but more-useful dialog:

{F1667318}

Prior to this change, the hash match was incorrectly not reported at all.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11051

Differential Revision: https://secure.phabricator.com/D15989

+7 -3
+1 -1
src/applications/differential/controller/DifferentialRevisionCloseDetailsController.php
··· 93 93 'href' => $obj_handle->getURI(), 94 94 ), 95 95 $obj_handle->getName()); 96 - $body_why = pht( 96 + $body_why[] = pht( 97 97 'This commit and the active diff of %s had the same %s hash '. 98 98 '(%s) so we linked this commit to %s.', 99 99 $diff_link,
+6 -2
src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php
··· 67 67 ->withCommitHashes($hash_list) 68 68 ->execute(); 69 69 70 - if (!empty($revisions)) { 70 + if ($revisions) { 71 71 $revision = $this->pickBestRevision($revisions); 72 + 72 73 $fields['revisionID'] = $revision->getID(); 73 74 $revision_hashes = $revision->getHashes(); 75 + 74 76 $revision_hashes = DiffusionCommitHash::convertArrayToObjects( 75 77 $revision_hashes); 76 - $revision_hashes = mpull($revision_hashes, 'getHashType'); 78 + $revision_hashes = mpull($revision_hashes, null, 'getHashType'); 79 + 77 80 // sort the hashes in the order the mighty 78 81 // @{class:ArcanstDifferentialRevisionHash} does; probably unnecessary 79 82 // but should future proof things nicely. 80 83 $revision_hashes = array_select_keys( 81 84 $revision_hashes, 82 85 ArcanistDifferentialRevisionHash::getTypes()); 86 + 83 87 foreach ($hashes as $hash) { 84 88 $revision_hash = idx($revision_hashes, $hash->getHashType()); 85 89 if (!$revision_hash) {