This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: support writing shared file (API)
ClosedPublic

Authored by indygreg on Sep 24 2018, 12:12 PM.

Details

Summary

Now that we can create a shared repository via creation options, we
can handle other special actions related to share at repo creation time
as well.

One of the things we do after creating a shared repository is write
out a .hg/shared file containing the list of additional things to
share. Of which only "bookmarks" is supported.

We add a creation option to hold the set of additional items to
share. If items are defined, we write out the .hg/shared file at
repo creation time.

As part of this, we no longer hold the repo lock when writing the
file. I'm pretty sure we don't care about the tiny race condition
window. I'm also pretty sure the reason we used the lock was because
the vfs auditor on the repo instance complained otherwise. Since the
repo creation code doesn't have an audited vfs, we don't need to
appease it.

Because we no longer need to tell the post share hook what items
are shared, the "bookmarks" argument to that function has been
dropped, incurring an API change.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

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