/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/smart/ping.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Ping plugin for bzr."""
 
17
"""Ping plugin for brz."""
18
18
 
19
19
from __future__ import absolute_import
20
20
 
21
 
from bzrlib.commands import Command
22
 
from bzrlib.lazy_import import lazy_import
 
21
from ..commands import Command
 
22
from ..lazy_import import lazy_import
23
23
 
24
24
lazy_import(globals(), """
25
 
from bzrlib import errors
26
 
from bzrlib.smart.client import _SmartClient
27
 
from bzrlib.transport import get_transport
 
25
from breezy import errors
 
26
from breezy.smart.client import _SmartClient
 
27
from breezy.transport import get_transport
28
28
""")
29
29
 
30
30
 
31
31
class cmd_ping(Command):
32
32
    """Pings a Bazaar smart server.
33
 
    
34
 
    This command sends a 'hello' request to the given location using the bzr
 
33
 
 
34
    This command sends a 'hello' request to the given location using the brz
35
35
    smart protocol, and reports the response.
36
36
    """
37
37
 
41
41
        transport = get_transport(location)
42
42
        try:
43
43
            medium = transport.get_smart_medium()
44
 
        except errors.NoSmartMedium, e:
 
44
        except errors.NoSmartMedium as e:
45
45
            raise errors.BzrCommandError(str(e))
46
46
        client = _SmartClient(medium)
47
47
        # Use call_expecting_body (even though we don't expect a body) so that