diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -694,7 +694,7 @@ coreconfigitem('format', 'obsstore-versi default=None, ) coreconfigitem('format', 'sparse-revlog', - default=False, + default=True, ) coreconfigitem('format', 'usefncache', default=True, diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -269,7 +269,7 @@ class sparserevlog(requirementformatvari _requirement = localrepo.SPARSEREVLOG_REQUIREMENT - default = False + default = True description = _('in order to limit disk reading and memory usage on older ' 'version, the span of a delta chain from its root to its ' diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -56,7 +56,7 @@ An upgrade of a repository created with fncache: yes dotencode: yes generaldelta: yes - sparserevlog: no + sparserevlog: yes plain-cl-delta: yes compression: zlib $ hg debugformat --verbose @@ -64,7 +64,7 @@ An upgrade of a repository created with fncache: yes yes yes dotencode: yes yes yes generaldelta: yes yes yes - sparserevlog: no no no + sparserevlog: yes yes yes plain-cl-delta: yes yes yes compression: zlib zlib zlib $ hg debugformat --verbose --config format.usefncache=no @@ -72,7 +72,7 @@ An upgrade of a repository created with fncache: yes no yes dotencode: yes no yes generaldelta: yes yes yes - sparserevlog: no no no + sparserevlog: yes yes yes plain-cl-delta: yes yes yes compression: zlib zlib zlib $ hg debugformat --verbose --config format.usefncache=no --color=debug @@ -80,7 +80,7 @@ An upgrade of a repository created with [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] - [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] + [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] $ hg debugformat -Tjson @@ -104,10 +104,10 @@ An upgrade of a repository created with "repo": true }, { - "config": false, - "default": false, + "config": true, + "default": true, "name": "sparserevlog", - "repo": false + "repo": true }, { "config": true, @@ -127,7 +127,7 @@ An upgrade of a repository created with performing an upgrade with "--run" will make the following changes: requirements - preserved: dotencode, fncache, generaldelta, revlogv1, store + preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store additional optimizations are available by specifying "--optimize ": @@ -151,7 +151,7 @@ An upgrade of a repository created with performing an upgrade with "--run" will make the following changes: requirements - preserved: dotencode, fncache, generaldelta, revlogv1, store + preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store redeltaparent deltas within internal storage will choose a new base revision if needed @@ -188,7 +188,7 @@ Various sub-optimal detections work fncache: no yes yes dotencode: no yes yes generaldelta: no yes yes - sparserevlog: no no no + sparserevlog: no yes yes plain-cl-delta: yes yes yes compression: zlib zlib zlib $ hg debugformat --verbose --config format.usegeneraldelta=no @@ -196,7 +196,7 @@ Various sub-optimal detections work fncache: no yes yes dotencode: no yes yes generaldelta: no no yes - sparserevlog: no no no + sparserevlog: no no yes plain-cl-delta: yes yes yes compression: zlib zlib zlib $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug @@ -204,7 +204,7 @@ Various sub-optimal detections work [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] - [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] + [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] $ hg debugupgraderepo @@ -219,12 +219,15 @@ Various sub-optimal detections work generaldelta deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower + sparserevlog + in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange. + performing an upgrade with "--run" will make the following changes: requirements preserved: revlogv1, store - added: dotencode, fncache, generaldelta + added: dotencode, fncache, generaldelta, sparserevlog fncache repository will be more resilient to storing certain paths and performance of certain operations should be improved @@ -235,6 +238,9 @@ Various sub-optimal detections work generaldelta repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster + sparserevlog + Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. + additional optimizations are available by specifying "--optimize ": redeltaparent @@ -259,6 +265,9 @@ Various sub-optimal detections work generaldelta deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower + sparserevlog + in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange. + repository lacks features used by the default config options: dotencode @@ -269,7 +278,7 @@ Various sub-optimal detections work requirements preserved: revlogv1, store - added: fncache, generaldelta + added: fncache, generaldelta, sparserevlog fncache repository will be more resilient to storing certain paths and performance of certain operations should be improved @@ -277,6 +286,9 @@ Various sub-optimal detections work generaldelta repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster + sparserevlog + Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. + additional optimizations are available by specifying "--optimize ": redeltaparent @@ -301,7 +313,7 @@ Upgrading a repository that is already m upgrade will perform the following actions: requirements - preserved: dotencode, fncache, generaldelta, revlogv1, store + preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store beginning upgrade... repository locked and read-only @@ -435,7 +447,7 @@ store files with special filenames aren' upgrade will perform the following actions: requirements - preserved: dotencode, fncache, generaldelta, revlogv1, store + preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store beginning upgrade... repository locked and read-only @@ -466,7 +478,7 @@ store files with special filenames aren' upgrade will perform the following actions: requirements - preserved: dotencode, fncache, generaldelta, revlogv1, store + preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store redeltafulladd each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it @@ -523,13 +535,14 @@ Check upgrading a large file repository generaldelta largefiles revlogv1 + sparserevlog store $ hg debugupgraderepo --run upgrade will perform the following actions: requirements - preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, store + preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store beginning upgrade... repository locked and read-only @@ -561,6 +574,7 @@ Check upgrading a large file repository generaldelta largefiles revlogv1 + sparserevlog store $ cat << EOF >> .hg/hgrc @@ -581,7 +595,7 @@ Check upgrading a large file repository upgrade will perform the following actions: requirements - preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, store + preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store beginning upgrade... repository locked and read-only @@ -667,16 +681,16 @@ repository config is taken in account $ hg config format format.maxchainlen=9001 $ hg debugdeltachain file - rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio - 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 - 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 - 2 2 1 -1 base 84 200 84 0.42000 84 0 0.00000 + rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks + 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1 + 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1 + 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1 $ hg debugupgraderepo --run --optimize redeltaall upgrade will perform the following actions: requirements - preserved: dotencode, fncache, generaldelta, revlogv1, store + preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store redeltaall deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time @@ -686,14 +700,14 @@ repository config is taken in account creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) - migrating 1.05 KB in store; 882 bytes tracked data - migrating 1 filelogs containing 3 revisions (374 bytes in store; 573 bytes tracked data) - finished migrating 3 filelog revisions across 1 filelogs; change in size: -63 bytes + migrating 1019 bytes in store; 882 bytes tracked data + migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data) + finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data) finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data) finished migrating 3 changelog revisions; change in size: 0 bytes - finished migrating 9 total revisions; total change in store size: -63 bytes + finished migrating 9 total revisions; total change in store size: -9 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository @@ -706,10 +720,10 @@ repository config is taken in account copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified $ hg debugdeltachain file - rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio - 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 - 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 - 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 + rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks + 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1 + 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1 + 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1 $ cd .. $ cat << EOF >> $HGRCPATH