[PATCH 3 of 6 clone bundles] exchange: provide hint on how to disable clone bundles

Gregory Szorc gregory.szorc at gmail.com
Wed Oct 14 13:07:55 CDT 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1444765292 25200
#      Tue Oct 13 12:41:32 2015 -0700
# Node ID 9d89eee4a9ce6a4a0a235bdebdbe1683ba8eb321
# Parent  a46e2def3ea9bea154939c0ce56a0e47a25b2180
exchange: provide hint on how to disable clone bundles

If a clone bundle persistently fails to apply, users need a way to
disable it so they have a hope of the clone working. Change the hint for
the abort scenario to advertise the config option to disable clone
bundles.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1636,10 +1636,12 @@ def _maybeapplyclonebundle(pullop):
     elif repo.ui.configbool('ui', 'clonebundlefallback', False):
         repo.ui.warn(_('falling back to normal clone\n'))
     else:
         raise error.Abort(_('error applying bundle'),
-                          hint=_('consider contacting the server '
-                                 'operator if this error persists'))
+                          hint=_('if this error persists, consider contacting '
+                                 'the server operator or disable clone '
+                                 'bundles via '
+                                 '"--config experimental.clonebundles=false"'))
 
 def parseclonebundlesmanifest(repo, s):
     """Parses the raw text of a clone bundles manifest.
 
diff --git a/tests/test-clonebundles.t b/tests/test-clonebundles.t
--- a/tests/test-clonebundles.t
+++ b/tests/test-clonebundles.t
@@ -70,9 +70,9 @@ Manifest file with invalid URL aborts
   $ hg clone http://localhost:$HGPORT 404-url
   applying clone bundle from http://does.not.exist/bundle.hg
   error fetching bundle: [Errno -2] Name or service not known
   abort: error applying bundle
-  (consider contacting the server operator if this error persists)
+  (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
   [255]
 
 Server is not running aborts
 
@@ -80,9 +80,9 @@ Server is not running aborts
   $ hg clone http://localhost:$HGPORT server-not-runner
   applying clone bundle from http://localhost:$HGPORT1/bundle.hg
   error fetching bundle: [Errno 111] Connection refused
   abort: error applying bundle
-  (consider contacting the server operator if this error persists)
+  (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
   [255]
 
 Server returns 404
 
@@ -91,9 +91,9 @@ Server returns 404
   $ hg clone http://localhost:$HGPORT running-404
   applying clone bundle from http://localhost:$HGPORT1/bundle.hg
   HTTP error fetching bundle: HTTP Error 404: File not found
   abort: error applying bundle
-  (consider contacting the server operator if this error persists)
+  (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
   [255]
 
 We can override failure to fall back to regular clone
 


More information about the Mercurial-devel mailing list