[MERGE] Better infrastructure for tracking remote server version in SmartClientMedium

John Arbash Meinel john at arbash-meinel.com
Fri Jun 6 14:08:17 BST 2008


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

Andrew Bennetts wrote:
| Hi,
|
| This patch replaces the _remote_is_at_least_1_2 attribute on SmartClientMedium
| with a couple of methods.  This will keep the fallback logic in bzrlib/remote.py
| fairly simple when we add new RPCs in new versions, rather than needing to keep
| adding _remote_is_at_least_1_6 and trying to keep them all consistent with each
| other.
|
| It also has a small optimisation so that if protocol version is less than 3, it
| won't try any RPCs introduced in 1.6.  We don't have any new RPCs in 1.6 yet,
| but I'm about to send patches to add some :)
|
| -Andrew.
|
|

Why not use "*args" instead of requiring double parentheses. I know we didn't do
that for "deprecated_in((1,6))" I sort of wish we had.

def _is_remote_at_least(*version_tuple):
~  ...

I suppose if you are using a separate "version_tuple" object like your example,
but from what I can see, you don't actually do that anywhere in the code.


self._medium._remote_is_not(1, 6)
versus
self._medium._remote_is_not((1, 6))


Otherwise I think I like it. I'm not sure if it is the *best* way to do
cross-version compatibility, but it is *a* way, and I think using a version
tuple is better than our static "_remote_is_not_1_2".

John
=:->

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

iEYEARECAAYFAkhJNsEACgkQJdeBCYSNAAO2vQCfa/7shJ5DlZQwzNljfmgfyuu9
ZlAAoLagVmlX+4SNzw5ZXhu73cOJ/k3D
=ZxfC
-----END PGP SIGNATURE-----



More information about the bazaar mailing list