@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 several safety issues with repository URIs

Summary:
See PHI234. Several issues here:

- The warning about observing a repository in Read/Write mode checks the raw I/O type, not the effective I/O type. That means we can fail to warn if other URIs are set to "Default", and "Default" is "Read/Write" in practice.
- There's just an actual typo which prevents the "Observe" version of this error from triggering properly.

Additionally, add more forceful warnings that "Observe" and "Mirror" mean that you want to //replace// a repository with another one, not that we somehow merge branches selectively. It isn't necessarily obvious that "Observe" doesn't mean "merge/union", since the reasons it can't in the general case are somewhat subtle (conflicts between refs with the same names, detecting ref deletion).

Test Plan:
Read documentation. Hit the error locally by trying to "Observe" while in Read/Write mode:

{F5302655}

Reviewers: amckinley

Reviewed By: amckinley

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

+12 -2
+2 -2
src/applications/diffusion/editor/DiffusionURIEditor.php
··· 347 347 continue; 348 348 } 349 349 350 - $io_type = $uri->getIoType(); 350 + $io_type = $uri->getEffectiveIOType(); 351 351 352 352 if ($io_type == PhabricatorRepositoryURI::IO_READWRITE) { 353 353 if ($no_readwrite) { 354 - $readwite_conflict = $uri; 354 + $readwrite_conflict = $uri; 355 355 break; 356 356 } 357 357 }
+10
src/docs/user/userguide/diffusion_uris.diviner
··· 239 239 authorities: the observed remote copy and the hosted local copy. Take the 240 240 other URI out of //Read/Write// mode first. 241 241 242 + WARNING: If you observe a remote repository, the entire state of the working 243 + copy that Phabricator maintains will be deleted and replaced with the state of 244 + the remote. If some changes are present only in Phabricator's working copy, 245 + they will be unrecoverably destroyed. 246 + 242 247 **Mirror**: Phabricator will push any changes made to this repository to the 243 248 remote URI, keeping a read-only mirror hosted at that URI up to date. 244 249 ··· 250 255 It is possible to mirror a repository to another repository that is also 251 256 hosted by Phabricator by adding that other repository's URI, although this is 252 257 silly and probably very rarely of any use. 258 + 259 + WARNING: If you mirror to a remote repository, the entire state of that remote 260 + will be replaced with the state of the working copy Phabricator maintains. If 261 + some changes are present only in the remote, they will be unrecoverably 262 + destroyed. 253 263 254 264 **None**: Phabricator will not fetch changes from or push changes to this URI. 255 265 For builtin URIs, it will not let users fetch changes from or push changes to