D5155: bundle2: fix broken compression engine assertion

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Oct 18 20:52:43 UTC 2018


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  bundletype() is a function, so it needs to be called, and it is
  documented to return a 2-tuple. This code is untested, so that's why
  we haven't noticed the bad assertion.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/bundle2.py

CHANGE DETAILS

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -839,7 +839,7 @@
             params = self._readexact(paramssize)
             self._processallparams(params)
             yield params
-            assert self._compengine.bundletype == 'UN'
+            assert self._compengine.bundletype()[1] == 'UN'
         # From there, payload might need to be decompressed
         self._fp = self._compengine.decompressorreader(self._fp)
         emptycount = 0



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list