Patchwork D3393: bundle: introduce per-engine compression level

login
register
mail settings
Submitter phabricator
Date April 17, 2018, 8:46 p.m.
Message ID <03be37e6ead4a9fa3d9f486ee8602dc6@localhost.localdomain>
Download mbox | patch
Permalink /patch/31171/
State Not Applicable
Headers show

Comments

phabricator - April 17, 2018, 8:46 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6a7ff5816c5f: bundle: introduce per-engine compression level (authored by joerg.sonnenberger, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3393?vs=8360&id=8377

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/configitems.py
  tests/test-bundle-type.t

CHANGE DETAILS




To: joerg.sonnenberger, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/tests/test-bundle-type.t b/tests/test-bundle-type.t
--- a/tests/test-bundle-type.t
+++ b/tests/test-bundle-type.t
@@ -154,6 +154,11 @@ 
   $ f --size gzip-v2-level1.hg
   gzip-v2-level1.hg: size=475
 
+  $ hg --config experimental.bundlecomplevel.gzip=1 --config experimental.bundlelevel=9 bundle -a -t gzip-v2 gzip-v2-level1.hg
+  1 changesets found
+  $ f --size gzip-v2-level1.hg
+  gzip-v2-level1.hg: size=475
+
   $ cd ..
 
 #if zstd
diff --git a/mercurial/configitems.py b/mercurial/configitems.py
--- a/mercurial/configitems.py
+++ b/mercurial/configitems.py
@@ -440,6 +440,18 @@ 
 coreconfigitem('experimental', 'bundlecomplevel',
     default=None,
 )
+coreconfigitem('experimental', 'bundlecomplevel.bzip2',
+    default=None,
+)
+coreconfigitem('experimental', 'bundlecomplevel.gzip',
+    default=None,
+)
+coreconfigitem('experimental', 'bundlecomplevel.none',
+    default=None,
+)
+coreconfigitem('experimental', 'bundlecomplevel.zstd',
+    default=None,
+)
 coreconfigitem('experimental', 'changegroup3',
     default=False,
 )
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1260,7 +1260,10 @@ 
     # level without a) formalizing the bundlespec changes to declare it
     # b) introducing a command flag.
     compopts = {}
-    complevel = ui.configint('experimental', 'bundlecomplevel')
+    complevel = ui.configint('experimental',
+                             'bundlecomplevel.' + bundlespec.compression)
+    if complevel is None:
+        complevel = ui.configint('experimental', 'bundlecomplevel')
     if complevel is not None:
         compopts['level'] = complevel