diff --git a/fastmanifest/implementation.py b/fastmanifest/implementation.py --- a/fastmanifest/implementation.py +++ b/fastmanifest/implementation.py @@ -10,7 +10,13 @@ import time import heapq -from mercurial import manifest, mdiff, revlog, util +from mercurial import ( + error, + manifest, + mdiff, + revlog, + util, +) import cachemanager import cfastmanifest from metrics import metricscollector @@ -140,15 +146,29 @@ self.__treemanifest = cstore.treemanifest(store) else: store = self.manifestlog.datastore + self.ui.pushbuffer() try: store.get('', self.node) self.__treemanifest = cstore.treemanifest(store, self.node) - except KeyError: + # The buffer is only to eat certain errors, so show + # non-error messages. + output = self.ui.popbuffer() + if output: + self.ui.status(output) + except (KeyError, error.Abort): # Record that it doesn't exist, so we don't keep checking # the store. + self.ui.popbuffer() + # Eat the buffer so we don't print a remote: warning self.__treemanifest = False return None + except: + # Other errors should be printed + output = self.ui.popbuffer() + if output: + self.ui.status(output) + raise return self.__treemanifest diff --git a/treemanifest/__init__.py b/treemanifest/__init__.py --- a/treemanifest/__init__.py +++ b/treemanifest/__init__.py @@ -1024,6 +1024,16 @@ raise error.Abort(_('pull failed on remote'), hint=exc.hint) except error.BundleValueError as exc: raise error.Abort(_('missing support for %s') % exc) + finally: + # Manually destruct the peer, so we can collect any error output + remote.ui.pushbuffer() + remote._cleanup() + + # Redirect cleanup output to the repo.ui so callers can buffer it if + # desired. + output = remote.ui.popbuffer() + if output: + repo.ui.status(output) def _registerbundle2parts(): @bundle2.parthandler(TREEGROUP_PARTTYPE2, ('version', 'cache', 'category'))