[PATCH] cg1packer: fix `compressed` method

Stanislau Hlebik stash at fb.com
Wed Dec 14 12:58:32 EST 2016


# HG changeset patch
# User Stanislau Hlebik <stash at fb.com>
# Date 1481738036 28800
#      Wed Dec 14 09:53:56 2016 -0800
# Node ID f511d71c272bf87ea263cdcda3045e26fd5f8dfe
# Parent  4cdc738f8246c748dc1639754d0e7ced97d15e23
cg1packer: fix `compressed` method

`cg1packer.compressed()` returns True even if `self._type` is 'UN'. This patch
fixes it.

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -154,7 +154,7 @@
     # These methods (compressed, read, seek, tell) all appear to only
     # be used by bundlerepo, but it's a little hard to tell.
     def compressed(self):
-        return self._type is not None
+        return self._type is not None and self._type != 'UN'
     def read(self, l):
         return self._stream.read(l)
     def seek(self, pos):


More information about the Mercurial-devel mailing list