# HG changeset patch # User Gregory Szorc # Date 2015-10-15 21:53:32 # Node ID 69ac9aebbc55adfc49505b79a283b09226d895f0 # Parent 0c42b6bb23297d369f8c4dbd951df3d99895c9e7 exchange: don't print error codes after clone bundle failure We don't appear to print error codes elsewhere. The error codes are inconsistent between at least Linux and OS X and are more trouble than they are worth. Humans care about the error string more than the code anyway. A glob was also added to pave over differences in error strings between Linux and OS X. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1795,7 +1795,7 @@ def trypullbundlefromurl(ui, repo, url): except urllib2.HTTPError as e: ui.warn(_('HTTP error fetching bundle: %s\n') % str(e)) except urllib2.URLError as e: - ui.warn(_('error fetching bundle: %s\n') % e.reason) + ui.warn(_('error fetching bundle: %s\n') % e.reason[1]) return False finally: diff --git a/tests/test-clonebundles.t b/tests/test-clonebundles.t --- a/tests/test-clonebundles.t +++ b/tests/test-clonebundles.t @@ -80,7 +80,7 @@ Manifest file with invalid URL aborts $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest $ 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 + error fetching bundle: * not known (glob) abort: error applying bundle (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false") [255] @@ -90,7 +90,7 @@ Server is not running aborts $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest $ hg clone http://localhost:$HGPORT server-not-runner applying clone bundle from http://localhost:$HGPORT1/bundle.hg - error fetching bundle: [Errno 111] Connection refused + error fetching bundle: Connection refused abort: error applying bundle (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false") [255]