[PATCH] cg1packer: fix `compressed` method

Augie Fackler raf at durin42.com
Thu Dec 15 11:48:03 EST 2016


On Wed, Dec 14, 2016 at 09:58:32AM -0800, Stanislau Hlebik wrote:
> # 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

Oops. Queued, thanks.

>
> `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):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list