/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/transport/remote.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-23 15:29:35 UTC
  • mfrom: (3943.7.7 bzr.code_style_cleanup)
  • mto: This revision was merged to the branch mainline in revision 4033.
  • Revision ID: john@arbash-meinel.com-20090223152935-oel9m92mwcc6nb4h
Merge the removal of all trailing whitespace, and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""RemoteTransport client for the smart-server.
18
18
 
34
34
    urlutils,
35
35
    )
36
36
from bzrlib.smart import client, medium
37
 
from bzrlib.symbol_versioning import (
38
 
    deprecated_method,
39
 
    )
 
37
from bzrlib.symbol_versioning import (deprecated_method, one_four)
40
38
 
41
39
 
42
40
class _SmartStat(object):
92
90
            should only be used for testing purposes; normally this is
93
91
            determined from the medium.
94
92
        """
95
 
        super(RemoteTransport, self).__init__(
96
 
            url, _from_transport=_from_transport)
 
93
        super(RemoteTransport, self).__init__(url,
 
94
                                              _from_transport=_from_transport)
97
95
 
98
96
        # The medium is the connection, except when we need to share it with
99
97
        # other objects (RemoteBzrDir, RemoteRepository etc). In these cases
100
98
        # what we want to share is really the shared connection.
101
99
 
102
 
        if (_from_transport is not None
103
 
            and isinstance(_from_transport, RemoteTransport)):
104
 
            _client = _from_transport._client
105
 
        elif _from_transport is None:
 
100
        if _from_transport is None:
106
101
            # If no _from_transport is specified, we need to intialize the
107
102
            # shared medium.
108
103
            credentials = None
138
133
        # No credentials
139
134
        return None, None
140
135
 
141
 
    def _report_activity(self, bytes, direction):
142
 
        """See Transport._report_activity.
143
 
 
144
 
        Does nothing; the smart medium will report activity triggered by a
145
 
        RemoteTransport.
146
 
        """
147
 
        pass
148
 
 
149
136
    def is_readonly(self):
150
137
        """Smart server transport can do read/write file operations."""
151
138
        try:
168
155
    def get_smart_medium(self):
169
156
        return self._get_connection()
170
157
 
 
158
    @deprecated_method(one_four)
 
159
    def get_shared_medium(self):
 
160
        return self._get_shared_connection()
 
161
 
171
162
    def _remote_path(self, relpath):
172
163
        """Returns the Unicode version of the absolute path for relpath."""
173
164
        return self._combine_paths(self._path, relpath)
593
584
    """Simple transport that handles ssh:// and points out bzr+ssh://."""
594
585
 
595
586
    def __init__(self, url):
596
 
        raise errors.UnsupportedProtocol(url,
 
587
        raise errors.UnsupportedProtocol(url, 
597
588
            'bzr supports bzr+ssh to operate over ssh, use "bzr+%s".' % url)
598
589
 
599
590
 
601
592
    """Return (transport, server) permutations for testing."""
602
593
    ### We may need a little more test framework support to construct an
603
594
    ### appropriate RemoteTransport in the future.
604
 
    from bzrlib.tests import test_server
605
 
    return [(RemoteTCPTransport, test_server.SmartTCPServer_for_testing)]
 
595
    from bzrlib.smart import server
 
596
    return [(RemoteTCPTransport, server.SmartTCPServer_for_testing)]