share

Description

Automatic Pooled Storage for Clones

When this extension is active, hg clone can be configured to automatically share/pool storage across multiple clones. This mode effectively converts hg clone to hg clone + hg share. The benefit of using this mode is the automatic management of store paths and intelligent pooling of related repositories.

The following share. config options influence this feature:

share.pool
Filesystem path where shared repository data will be stored. When defined, hg clone will automatically use shared repository storage instead of creating a store inside each clone.
share.poolnaming

How directory names in share.pool are constructed.

"identity" means the name is derived from the first changeset in the repository. In this mode, different remotes share storage if their root/initial changeset is identical. In this mode, the local shared repository is an aggregate of all encountered remote repositories.

"remote" means the name is derived from the source repository's path or URL. In this mode, storage is only shared if the path or URL requested in the hg clone command matches exactly to a repository that was cloned before.

The default naming mode is "identity".

Commands

share

create a new shared repository:

hg share [-U] [-B] SOURCE [DEST]

Initialize a new repository and working directory that shares its history (and optionally bookmarks) with another repository.

Note

using rollback or extensions that destroy/modify history (mq, rebase, etc.) can cause considerable confusion with shared clones. In particular, if two shared clones are both updated to the same changeset, and one of them destroys that changeset with rollback, the other clone will suddenly stop working: all operations will fail with "abort: working directory has unknown parent". The only known workaround is to use debugsetparents on the broken clone to reset it to a changeset that still exists.

Options:

-U, --noupdate do not create a working directory
-B, --bookmarks
 also share bookmarks
--relative point to source using a relative path (EXPERIMENTAL)

unshare

convert a shared repository to a normal one:

hg unshare

Copy the store data to the repo and remove the sharedpath data.