/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: Martin Pool
  • Date: 2008-02-06 00:41:04 UTC
  • mfrom: (3215 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3219.
  • Revision ID: mbp@sourcefrog.net-20080206004104-mxtn32habuhjq6b8
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
                    trace.mutter('hpss: Built a new medium: %s',
103
103
                                 medium.__class__.__name__)
104
104
            self._shared_connection = transport._SharedConnection(medium,
105
 
                                                                  credentials)
 
105
                                                                  credentials,
 
106
                                                                  self.base)
106
107
 
107
108
        if _client is None:
108
109
            self._client = client._SmartClient(self.get_shared_medium())
282
283
        # the external path for RemoteTransports is the base
283
284
        return self.base
284
285
 
 
286
    def recommended_page_size(self):
 
287
        """Return the recommended page size for this transport."""
 
288
        return 64 * 1024
 
289
        
285
290
    def _readv(self, relpath, offsets):
286
291
        if not offsets:
287
292
            return
502
507
        """After connecting, HTTP Transport only deals in relative URLs."""
503
508
        # Adjust the relpath based on which URL this smart transport is
504
509
        # connected to.
505
 
        http_base = urlutils.normalize_url(self._http_transport.base)
 
510
        http_base = urlutils.normalize_url(self.get_smart_medium().base)
506
511
        url = urlutils.join(self.base[len('bzr+'):], relpath)
507
512
        url = urlutils.normalize_url(url)
508
513
        return urlutils.relative_url(http_base, url)
519
524
        smart requests may be different).  This is so that the server doesn't
520
525
        have to handle .bzr/smart requests at arbitrary places inside .bzr
521
526
        directories, just at the initial URL the user uses.
522
 
 
523
 
        The exception is parent paths (i.e. relative_url of "..").
524
527
        """
525
528
        if relative_url:
526
529
            abs_url = self.abspath(relative_url)
527
530
        else:
528
531
            abs_url = self.base
529
 
        # We either use the exact same http_transport (for child locations), or
530
 
        # a clone of the underlying http_transport (for parent locations).  This
531
 
        # means we share the connection.
532
 
        norm_base = urlutils.normalize_url(self.base)
533
 
        norm_abs_url = urlutils.normalize_url(abs_url)
534
 
        normalized_rel_url = urlutils.relative_url(norm_base, norm_abs_url)
535
 
        if normalized_rel_url == ".." or normalized_rel_url.startswith("../"):
536
 
            http_transport = self._http_transport.clone(normalized_rel_url)
537
 
        else:
538
 
            http_transport = self._http_transport
539
532
        return RemoteHTTPTransport(abs_url,
540
533
                                   _from_transport=self,
541
 
                                   http_transport=http_transport)
 
534
                                   http_transport=self._http_transport)
542
535
 
543
536
 
544
537
def get_test_permutations():