This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: support shared repo creation
ClosedPublic

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

Details

Summary

Previously, hg.share() had its own logic for creating a new
repository on the filesystem.

With the recent introduction of the createopts dict for passing
options to influence repository creation, it is now possible
to consolidate the repo creation code for both the normal and
shared use cases.

This commit teaches the repo creation code in localrepo to
recognize when we're creating a shared repo and to act
appropriately.

Meaningful behavior should be identical. However, there are a
few subtle changes:

  • The .hg/requires file is written out in sorted order (rather than having share-related requirements appended at end).
  • The .hg directory is created with notindexed=True when a shared repo is being created.

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 24 2018, 12:12 PM
This revision was automatically updated to reflect the committed changes.