Code review comment for lp:~spiv/bzr/remove-dead-chk-code

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
> Andrew Bennetts has proposed merging lp:~spiv/bzr/remove-dead-chk-code into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> There's a large code-path in StreamSource._get_inventory_stream that is totally
> unused in current bzrlib. Unsurprisingly, it's also broken: there's no
> _find_revision_outside_set method anymore. So this branch deletes it (and
> replaces it with an assertion).
>
> For good measure it also fixes a trivial bug in RemoteRepositoryFormat to make
> sure that the .supports_chk attribute is accurate.
>
> -Andrew.
>
>
>

Actually, it isn't totally unused. It is used to copy data from a --dev7
format branch to a --2a format. Which happens to be broken as you say. :)

And I'm not positive, but I think this:

> +++ bzrlib/repository.py 2009-07-10 04:49:56 +0000
> @@ -4226,12 +4226,9 @@
>
> def _get_inventory_stream(self, revision_ids):
> from_format = self.from_repository._format
> - if (from_format.supports_chks and self.to_format.supports_chks
> - and (from_format._serializer == self.to_format._serializer)):
> - # Both sides support chks, and they use the same serializer, so it
> - # is safe to transmit the chk pages and inventory pages across
> - # as-is.
> - return self._get_chk_inventory_stream(revision_ids)
> + if (from_format.supports_chks and self.to_format.supports_chks):
> + raise AssertionError(
> + "This StreamSource should not be used for chk->chk fetches.")
> elif (not from_format.supports_chks):
> # Source repository doesn't support chks. So we can transmit the
> # inventories 'as-is' and either they are just accepted on the

^- actually should be "format.supports_chks or to_format.supports_chks".

Perhaps not, though.

  review approve
  merge approve

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpXeiEACgkQJdeBCYSNAAN73ACfSAzYNc+52gN0ElTHVQs8llOE
pS0AniDM6pkVcfd36YJB9lqORPf+pmvm
=ytfn
-----END PGP SIGNATURE-----

review: Approve

« Back to merge proposal