D5345: sparse-revlog: enabled by default

lothiraldan (Boris Feld) phabricator at mercurial-scm.org
Mon Dec 10 11:10:33 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3764330f76a6: sparse-revlog: enabled by default (authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5345?vs=12654&id=12805

REVISION DETAIL
  https://phab.mercurial-scm.org/D5345

AFFECTED FILES
  mercurial/configitems.py
  mercurial/upgrade.py
  tests/test-upgrade-repo.t

CHANGE DETAILS

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,31 +56,31 @@
   fncache:        yes
   dotencode:      yes
   generaldelta:   yes
-  sparserevlog:    no
+  sparserevlog:   yes
   plain-cl-delta: yes
   compression:    zlib
   $ hg debugformat --verbose
   format-variant repo config default
   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
   format-variant repo config default
   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
   format-variant repo config default
   [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 @@
     "repo": true
    },
    {
-    "config": false,
-    "default": false,
+    "config": true,
+    "default": true,
     "name": "sparserevlog",
-    "repo": false
+    "repo": true
    },
    {
     "config": true,
@@ -127,7 +127,7 @@
   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 <name>":
   
@@ -151,7 +151,7 @@
   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,23 +188,23 @@
   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
   format-variant repo config default
   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
   format-variant repo config default
   [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 @@
   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 @@
   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 <name>":
   
   redeltaparent
@@ -259,6 +265,9 @@
   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,14 +278,17 @@
   
   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
   
   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 <name>":
   
   redeltaparent
@@ -301,7 +313,7 @@
   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 @@
   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 @@
   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 @@
   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 @@
   generaldelta
   largefiles
   revlogv1
+  sparserevlog
   store
 
   $ cat << EOF >> .hg/hgrc
@@ -581,7 +595,7 @@
   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 @@
   $ 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 @@
   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 @@
   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
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -269,7 +269,7 @@
 
     _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/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -694,7 +694,7 @@
     default=None,
 )
 coreconfigitem('format', 'sparse-revlog',
-    default=False,
+    default=True,
 )
 coreconfigitem('format', 'usefncache',
     default=True,



To: lothiraldan, #hg-reviewers, durin42, indygreg
Cc: indygreg, durin42, pulkit, mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list