[MERGE][#248153] Add autopack RPC
John Arbash Meinel
john at arbash-meinel.com
Thu Oct 30 14:04:41 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> Martin Pool has voted comment.
> Status is now: Semi-approved
> Comment:
> This definitely deserves a mention in NEWS, including some kind of
> quantification of what improvement it will give you, and a description of
> what will happen if the server is too old.
>
> + def autopack(self):
> + path = self.bzrdir._path_for_remote_call(self._client)
> + try:
> + response = self._client.call('PackRepository.autopack', path)
> + except errors.ErrorFromSmartServer, err:
> + self._translate_error(err)
> + except errors.UnknownSmartMethod:
> + self._ensure_real()
> + self._real_repository._pack_collection.autopack()
> + return
> + if self._real_repository is not None:
> + # Reset the real repository's cache of pack names.
> + self._real_repository._pack_collection.reload_pack_names()
> + if response != ('ok',):
> + raise errors.UnexpectedSmartServerResponse(response)
> +
>
> While we're here, it seems like an obvious opportunity to have the
> PackRepository.autopack command return the pack names data, so that we
> don't need to do another roundtrip. I can see two counterarguments
> though, one being that it might not be trivial to inject it into the
> _real_repository, and the other that if we can often get away without
> vfs-based operations it may be unnecessary. But at least the second does
> not seem to be true in the near future.
I agree that returning 'pack-names' seems reasonable, and it shouldn't
be very hard to factor 'reload_pack_names' one more time to allow
passing in the name list.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkJvvkACgkQJdeBCYSNAANCoQCgpaFDincHAC9W1TwM737qoIX8
ecsAoItT/Sd0Givd/6XIhoCpcQ6dJWqY
=Sp8D
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list