/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 bzrlib/smart/medium.py

  • Committer: Jelmer Vernooij
  • Date: 2010-03-21 21:39:33 UTC
  • mfrom: (5102 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5143.
  • Revision ID: jelmer@samba.org-20100321213933-fexeh9zcoz8oaju2
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
33
33
from bzrlib.lazy_import import lazy_import
34
34
lazy_import(globals(), """
35
35
import atexit
36
 
import threading
 
36
import thread
37
37
import weakref
38
38
 
39
39
from bzrlib import (
300
300
        tstart = osutils.timer_func()
301
301
        osutils.send_all(self.socket, bytes, self._report_activity)
302
302
        if 'hpss' in debug.debug_flags:
303
 
            cur_thread = threading.currentThread()
304
 
            thread_id = getattr(cur_thread, 'ident', None)
305
 
            if thread_id is None:
306
 
                thread_id = cur_thread.getName()
 
303
            thread_id = thread.get_ident()
307
304
            trace.mutter('%12s: [%s] %d bytes to the socket in %.3fs'
308
305
                         % ('wrote', thread_id, len(bytes),
309
306
                            osutils.timer_func() - tstart))
752
749
        self._password = password
753
750
        self._port = port
754
751
        self._username = username
 
752
        # for the benefit of progress making a short description of this
 
753
        # transport
 
754
        self._scheme = 'bzr+ssh'
755
755
        # SmartClientStreamMedium stores the repr of this object in its
756
756
        # _DebugCounter so we have to store all the values used in our repr
757
757
        # method before calling the super init.
761
761
        self._vendor = vendor
762
762
        self._write_to = None
763
763
        self._bzr_remote_path = bzr_remote_path
764
 
        # for the benefit of progress making a short description of this
765
 
        # transport
766
 
        self._scheme = 'bzr+ssh'
767
764
 
768
765
    def __repr__(self):
769
 
        return "%s(connected=%r, username=%r, host=%r, port=%r)" % (
 
766
        if self._port is None:
 
767
            maybe_port = ''
 
768
        else:
 
769
            maybe_port = ':%s' % self._port
 
770
        return "%s(%s://%s@%s%s/)" % (
770
771
            self.__class__.__name__,
771
 
            self._connected,
 
772
            self._scheme,
772
773
            self._username,
773
774
            self._host,
774
 
            self._port)
 
775
            maybe_port)
775
776
 
776
777
    def _accept_bytes(self, bytes):
777
778
        """See SmartClientStreamMedium.accept_bytes."""