( )⚙ D4573 localrepo: resolve store and cachevfs in makelocalrepository()

This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: resolve store and cachevfs in makelocalrepository()
ClosedPublic

Authored by indygreg on Sep 13 2018, 12:29 PM.

Details

Summary

This is mostly a code move and refactor.

One change is that we now explicitly look for requirements indicating
a share is being used rather than blindly try to read from
.hg/sharedpath. Requirements *should* be all that is necessary to
dictate high-level behavior and I'm not sure why the previous code
was doing what it was.

The previous code has been in place since 87d1fd40f57e (authored in
2009). And the commit immediately after that (971e38a9344b) introduced
`hg.share() and always wrote the shared` requirement. And as far
as I can tell, every revision of `hg.share()` since has written
either the `shared or relshared` requirement. So I'm pretty
sure we don't need to maintain BC by always looking for and honoring
the `.hg/sharedpath` file even if a requirement isn't present.

.. bc::

A repository will no longer use shared storage if it has a
``.hg/sharedpath`` file but no entry in ``.hg/requires`` saying it
is shared.

This change should not have any end-user impact, as all shared
repos should have a ``.hg/requires`` file indicating this.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Sep 13 2018, 12:29 PM
This revision was automatically updated to reflect the committed changes.