revlogv2: make sure bundling pick a compatible bundle format
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 30 May 2021 22:12:48 +0200
changeset 47342 dc3800569157
parent 47341 24ea3ef35238
child 47345 710435a5c469
revlogv2: make sure bundling pick a compatible bundle format Before this change, revlog-v2 repository where bundled using the incompatible "v1" format. Differential Revision: https://phab.mercurial-scm.org/D10802
mercurial/bundlecaches.py
tests/test-revlog-v2.t
--- a/mercurial/bundlecaches.py	Sun May 30 20:42:51 2021 +0200
+++ b/mercurial/bundlecaches.py	Sun May 30 22:12:48 2021 +0200
@@ -167,6 +167,8 @@
             # Generaldelta repos require v2.
             if requirementsmod.GENERALDELTA_REQUIREMENT in repo.requirements:
                 version = b'v2'
+            elif requirementsmod.REVLOGV2_REQUIREMENT in repo.requirements:
+                version = b'v2'
             # Modern compression engines require v2.
             if compression not in _bundlespecv1compengines:
                 version = b'v2'
--- a/tests/test-revlog-v2.t	Sun May 30 20:42:51 2021 +0200
+++ b/tests/test-revlog-v2.t	Sun May 30 22:12:48 2021 +0200
@@ -69,6 +69,14 @@
   .hg/store/data/foo.i:
   0000: 00 00 de ad                                     |....|
 
+Bundle use a compatible changegroup format
+------------------------------------------
+
+  $ hg bundle --all ../basic.hg
+  1 changesets found
+  $ hg debugbundle --spec ../basic.hg
+  bzip2-v2
+
 The expected files are generated
 --------------------------------