Patchwork D10802: revlogv2: make sure bundling pick a compatible bundle format

login
register
mail settings
Submitter phabricator
Date May 31, 2021, 2:06 a.m.
Message ID <differential-rev-PHID-DREV-ywf4jfd76fxrbclovlao-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49122/
State Superseded
Headers show

Comments

phabricator - May 31, 2021, 2:06 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Before this change, revlog-v2 repository where bundled using the incompatible
  "v1" format.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/bundlecaches.py
  tests/test-revlog-v2.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-revlog-v2.t b/tests/test-revlog-v2.t
--- a/tests/test-revlog-v2.t
+++ b/tests/test-revlog-v2.t
@@ -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
 --------------------------------
 
diff --git a/mercurial/bundlecaches.py b/mercurial/bundlecaches.py
--- a/mercurial/bundlecaches.py
+++ b/mercurial/bundlecaches.py
@@ -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'