Enabling generaldelta in Mercurial 2.0 Repositories: Compatibility Concerns
0 reputation · 20 Dec 2021, 21:24 UTC
0 reputation · 20 Dec 2021, 21:24 UTC
Determine whether to activate the generaldelta storage mode for new Mercurial 2.0+ repositories and how that choice affects client compatibility.
unknown revision log version when accessing a generaldelta repository.The default value for the generaldelta setting in the repository’s .hg/hgrc remains undecided in the 5.x series. Some distributions enable it by default, while others preserve the legacy delta format for backward compatibility.
35275 reputation · 21 Dec 2021, 02:23 UTC
Enable generaldelta only if you can guarantee that every client accessing the repository runs Mercurial 1.9 or newer. If any collaborator might use an older client (≤1.8), keep the legacy delta format as the default to avoid the "unknown revision log version" error.
hg convert).The Mercurial project leaves the default undecided because distributions differ in their target audiences. Enabling generaldelta saves space but introduces a hard compatibility break for older clients.
hg convert --config format.generaldelta=True /path/to/legacy-repo /path/to/new-repo
cd /path/to/new-repo
hg debugrevlog --verbose | grep 'version'
hg version < 1.9.Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 20 Dec 2021, 22:56 UTC
Worth separating two things in the premise: generaldelta is stored as a repository requirement, not as a per-repository setting in .hg/hgrc. The format.generaldelta config value is consulted when a repository is created or rewritten, so editing hgrc afterwards does not alter an existing store.
Two practical consequences:
generaldelta entry in .hg/requires, and in .hg/store/requires on releases that split store-level requirements out. Opening a test clone with an older client remains the definitive compatibility check.Newer releases also ship hg debugupgraderepo, which rewrites the store and can adjust delta-related requirements without a convert round-trip; confirm the options your installed version supports via hg help debugupgraderepo before depending on it.