/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Andrew Bennetts
  • Date: 2009-07-02 00:28:49 UTC
  • mto: (0.52.2 ping)
  • mto: This revision was merged to the branch mainline in revision 6559.
  • Revision ID: andrew@bemusement.org-20090702002849-n62tl8ie6gxe9yi4
Capture and report any headers from the response.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        except errors.NoSmartMedium, e:
43
43
            raise errors.BzrCommandError(str(e))
44
44
        client = _SmartClient(medium)
45
 
        response = client.call('hello')
 
45
        # Use call_expecting_body (even though we don't expect a body) so that
 
46
        # we can see the response headers (if any) via the handler object.
 
47
        response, handler = client.call_expecting_body('hello')
 
48
        handler.cancel_read_body()
46
49
        self.outf.write('Response: %r\n' % (response,))
 
50
        if getattr(handler, 'headers', None) is not None:
 
51
            self.outf.write('Headers: %r\n' % (handler.headers,))
47
52
 
48
53
register_command(cmd_ping)