@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.

Explicitly update the repository URI index after making a URI edit

Summary:
Fixes T11936. After editing a repository URI, we were not correctly updating the URI index.

Any other edit to the repository //would// update the index, and this index is only really used by `arc` to figure out which repository a working copy belongs to, so that's how this evaded detection for this long. In particular, creating a repository would usually have an edit after any URI edits, to activate it, which would build the index correctly.

Test Plan:
- Added a new URI to a repository.
- Verified it was immediately reflected in the `repository_uriindex` table.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11936

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

+8
+8
src/applications/diffusion/editor/DiffusionURIEditor.php
··· 462 462 ->withRepositories(array($repository)) 463 463 ->execute(); 464 464 465 + // Reattach the current URIs to the repository: we're going to rebuild 466 + // the index explicitly below, and want to include any changes made to 467 + // this URI in the index update. 468 + $repository->attachURIs($uris); 469 + 465 470 $observe_uri = null; 466 471 foreach ($uris as $uri) { 467 472 if ($uri->getIoType() != PhabricatorRepositoryURI::IO_OBSERVE) { ··· 487 492 } 488 493 489 494 $repository->save(); 495 + 496 + // Explicitly update the URI index. 497 + $repository->updateURIIndex(); 490 498 491 499 $is_hosted = $repository->isHosted(); 492 500