a patch for #308472: show the server version
Andrew Bennetts
andrew.bennetts at canonical.com
Tue Jul 7 14:36:32 BST 2009
Stephen Emslie wrote:
> Here is a patch for bug #308472 that came out of the Bazaar sprint at
> EuroPython this afternoon.
>
> The patch adds the server version number to the output of "bzr info" when
> connected to a smart server. It could probably use some polish, but gives
> the general idea.
[...]
> + from bzrlib.smart.client import _SmartClient
> + if isinstance(repository._client, _SmartClient):
> + server_version = repository._client._headers['Software version']
> + server_info = " (smart server %s)" % server_version
I'm pretty sure this will print the *client's* version, not the server's.
To find out the server's version you need to look at a response the server
sends.
The API for looking at response headers isn't particularly elegant yet, but
there's a simple example in:
http://bazaar.launchpad.net/~spiv/bzr-ping/trunk/annotate/head%3A/__init__.py
bb:resubmit
-Andrew.
More information about the bazaar
mailing list