Patchwork [4,of,5] debugformat: add information about sparse-revlog

login
register
mail settings
Submitter Boris Feld
Date July 16, 2018, 6:50 p.m.
Message ID <35a23148fd05821bc620.1531767024@FB-lair>
Download mbox | patch
Permalink /patch/32870/
State Accepted
Headers show

Comments

Boris Feld - July 16, 2018, 6:50 p.m.
# HG changeset patch
# User Paul Morelle <paul.morelle@octobus.net>
# Date 1529584381 -7200
#      Thu Jun 21 14:33:01 2018 +0200
# Node ID 35a23148fd05821bc620673e8217cbdb400f4412
# Parent  c34ef3def14e04dca76c43667766496a99636b44
# EXP-Topic write-for-sparse-read
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 35a23148fd05
debugformat: add information about sparse-revlog

Show information about sparse-revlog in debugformat, just like other
requirements.

Patch

diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -259,6 +259,28 @@  class generaldelta(requirementformatvari
                        'faster')
 
 @registerformatvariant
+class sparserevlog(requirementformatvariant):
+    name = 'sparserevlog'
+
+    _requirement = localrepo.SPARSEREVLOG_REQUIREMENT
+
+    default = False
+
+    description = _('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.'
+                   )
+
+    upgrademessage = _('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.')
+
+@registerformatvariant
 class removecldeltachain(formatvariant):
     name = 'plain-cl-delta'
 
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,6 +56,7 @@  An upgrade of a repository created with 
   fncache:        yes
   dotencode:      yes
   generaldelta:   yes
+  sparserevlog:    no
   plain-cl-delta: yes
   compression:    zlib
   $ hg debugformat --verbose
@@ -63,6 +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
   plain-cl-delta: yes    yes     yes
   compression:    zlib   zlib    zlib
   $ hg debugformat --verbose --config format.usegfncache=no
@@ -70,6 +72,7 @@  An upgrade of a repository created with 
   fncache:        yes    yes     yes
   dotencode:      yes    yes     yes
   generaldelta:   yes    yes     yes
+  sparserevlog:    no     no      no
   plain-cl-delta: yes    yes     yes
   compression:    zlib   zlib    zlib
   $ hg debugformat --verbose --config format.usegfncache=no --color=debug
@@ -77,6 +80,7 @@  An upgrade of a repository created with 
   [formatvariant.name.uptodate|fncache:       ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
   [formatvariant.name.uptodate|dotencode:     ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][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|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
@@ -100,6 +104,12 @@  An upgrade of a repository created with 
     "repo": true
    },
    {
+    "config": false,
+    "default": false,
+    "name": "sparserevlog",
+    "repo": false
+   },
+   {
     "config": true,
     "default": true,
     "name": "plain-cl-delta",
@@ -119,6 +129,9 @@  An upgrade of a repository created with 
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, store
   
+  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
@@ -143,6 +156,9 @@  An upgrade of a repository created with 
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, store
   
+  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.
+  
   redeltaparent
      deltas within internal storage will choose a new base revision if needed
   
@@ -170,6 +186,7 @@  Various sub-optimal detections work
   fncache:         no
   dotencode:       no
   generaldelta:    no
+  sparserevlog:    no
   plain-cl-delta: yes
   compression:    zlib
   $ hg debugformat --verbose
@@ -177,6 +194,7 @@  Various sub-optimal detections work
   fncache:         no    yes     yes
   dotencode:       no    yes     yes
   generaldelta:    no    yes     yes
+  sparserevlog:    no     no      no
   plain-cl-delta: yes    yes     yes
   compression:    zlib   zlib    zlib
   $ hg debugformat --verbose --config format.usegeneraldelta=no
@@ -184,6 +202,7 @@  Various sub-optimal detections work
   fncache:         no    yes     yes
   dotencode:       no    yes     yes
   generaldelta:    no     no     yes
+  sparserevlog:    no     no      no
   plain-cl-delta: yes    yes     yes
   compression:    zlib   zlib    zlib
   $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
@@ -191,6 +210,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.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
@@ -221,6 +241,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 <name>":
   
   redeltaparent
@@ -263,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 <name>":
   
   redeltaparent
@@ -289,6 +315,9 @@  Upgrading a repository that is already m
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, store
   
+  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.
+  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
@@ -326,6 +355,9 @@  Upgrading a repository to generaldelta w
   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.
+  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
@@ -423,6 +455,9 @@  store files with special filenames aren'
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, store
   
+  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.
+  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
@@ -454,6 +489,9 @@  store files with special filenames aren'
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, store
   
+  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.
+  
   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
   
@@ -512,6 +550,9 @@  Check upgrading a large file repository
   requirements
      preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, store
   
+  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.
+  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
@@ -564,6 +605,9 @@  Check upgrading a large file repository
   requirements
      preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, store
   
+  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.
+  
   beginning upgrade...
   repository locked and read-only
   creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
@@ -659,6 +703,9 @@  repository config is taken in account
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, store
   
+  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.
+  
   redeltaall
      deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time