exchange: make clonebundleprefers non-experimental
authorGregory Szorc <gregory.szorc@gmail.com>
Fri, 08 Jan 2016 10:57:01 -0800
changeset 27737 482eb357fe98
parent 27736 7644d3aeedec
child 27738 a0e783d26e81
exchange: make clonebundleprefers non-experimental In preparation for making the feature enabled by default.
hgext/clonebundles.py
mercurial/exchange.py
mercurial/help/config.txt
tests/test-clonebundles.t
--- a/hgext/clonebundles.py	Fri Jan 08 10:53:07 2016 -0800
+++ b/hgext/clonebundles.py	Fri Jan 08 10:57:01 2016 -0800
@@ -170,15 +170,6 @@
 
 experimental.clonebundles
    Whether the clone bundles feature is enabled on clients. Defaults to true.
-
-experimental.clonebundleprefers
-   List of "key=value" properties the client prefers in bundles. Downloaded
-   bundle manifests will be sorted by the preferences in this list. e.g.
-   the value "BUNDLESPEC=gzip-v1, BUNDLESPEC=bzip2-v1" will prefer a gzipped
-   version 1 bundle type then bzip2 version 1 bundle type.
-
-   If not defined, the order in the manifest will be used and the first
-   available bundle will be downloaded.
 """
 
 from mercurial import (
--- a/mercurial/exchange.py	Fri Jan 08 10:53:07 2016 -0800
+++ b/mercurial/exchange.py	Fri Jan 08 10:57:01 2016 -0800
@@ -1805,8 +1805,7 @@
     return newentries
 
 def sortclonebundleentries(ui, entries):
-    # experimental config: experimental.clonebundleprefers
-    prefers = ui.configlist('experimental', 'clonebundleprefers', default=[])
+    prefers = ui.configlist('ui', 'clonebundleprefers', default=[])
     if not prefers:
         return list(entries)
 
--- a/mercurial/help/config.txt	Fri Jan 08 10:53:07 2016 -0800
+++ b/mercurial/help/config.txt	Fri Jan 08 10:57:01 2016 -0800
@@ -1502,6 +1502,30 @@
 
     (default: False)
 
+``clonebundleprefers``
+    Defines preferences for which "clone bundles" to use.
+
+    Servers advertising "clone bundles" may advertise multiple available
+    bundles. Each bundle may have different attributes, such as the bundle
+    type and compression format. This option is used to prefer a particular
+    bundle over another.
+
+    The following keys are defined by Mercurial:
+
+    BUNDLESPEC
+       A bundle type specifier. These are strings passed to :hg:`bundle -t`.
+       e.g. ``gzip-v2`` or ``bzip2-v1``.
+
+    COMPRESSION
+       The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
+
+    Server operators may define custom keys.
+
+    Example values: ``COMPRESSION=bzip2``,
+    ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
+
+    By default, the first bundle advertised by the server is used.
+
 ``commitsubrepos``
     Whether to commit modified subrepositories when committing the
     parent repository. If False and one subrepository has uncommitted
--- a/tests/test-clonebundles.t	Fri Jan 08 10:53:07 2016 -0800
+++ b/tests/test-clonebundles.t	Fri Jan 08 10:57:01 2016 -0800
@@ -377,7 +377,7 @@
 
 Preferring an undefined attribute will take first entry
 
-  $ hg --config experimental.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
+  $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
   applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
   adding changesets
   adding manifests
@@ -389,7 +389,7 @@
 
 Preferring bz2 type will download first entry of that type
 
-  $ hg --config experimental.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
+  $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
   applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
   adding changesets
   adding manifests
@@ -401,7 +401,7 @@
 
 Preferring multiple values of an option works
 
-  $ hg --config experimental.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
+  $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
   applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
   adding changesets
   adding manifests
@@ -413,7 +413,7 @@
 
 Sorting multiple values should get us back to original first entry
 
-  $ hg --config experimental.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
+  $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
   applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
   adding changesets
   adding manifests
@@ -425,7 +425,7 @@
 
 Preferring multiple attributes has correct order
 
-  $ hg --config experimental.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
+  $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
   applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
   adding changesets
   adding manifests
@@ -444,7 +444,7 @@
   > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
   > EOF
 
-  $ hg --config experimental.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
+  $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
   applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
   adding changesets
   adding manifests