/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: Aaron Bentley
  • Date: 2008-02-24 16:42:13 UTC
  • mfrom: (3234 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3235.
  • Revision ID: aaron@aaronbentley.com-20080224164213-eza1lzru5bwuwmmj
Merge with bzr.dev

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
386
391
            else:
387
392
                error_path = resp[1]
388
393
            raise errors.ReadError(error_path)
 
394
        elif what == "PermissionDenied":
 
395
            if orig_path is not None:
 
396
                error_path = orig_path
 
397
            else:
 
398
                error_path = resp[1]
 
399
            raise errors.PermissionDenied(error_path)
389
400
        else:
390
401
            raise errors.SmartProtocolError('unexpected smart server error: %r' % (resp,))
391
402
 
496
507
        """After connecting, HTTP Transport only deals in relative URLs."""
497
508
        # Adjust the relpath based on which URL this smart transport is
498
509
        # connected to.
499
 
        http_base = urlutils.normalize_url(self._http_transport.base)
 
510
        http_base = urlutils.normalize_url(self.get_smart_medium().base)
500
511
        url = urlutils.join(self.base[len('bzr+'):], relpath)
501
512
        url = urlutils.normalize_url(url)
502
513
        return urlutils.relative_url(http_base, url)
513
524
        smart requests may be different).  This is so that the server doesn't
514
525
        have to handle .bzr/smart requests at arbitrary places inside .bzr
515
526
        directories, just at the initial URL the user uses.
516
 
 
517
 
        The exception is parent paths (i.e. relative_url of "..").
518
527
        """
519
528
        if relative_url:
520
529
            abs_url = self.abspath(relative_url)
521
530
        else:
522
531
            abs_url = self.base
523
 
        # We either use the exact same http_transport (for child locations), or
524
 
        # a clone of the underlying http_transport (for parent locations).  This
525
 
        # means we share the connection.
526
 
        norm_base = urlutils.normalize_url(self.base)
527
 
        norm_abs_url = urlutils.normalize_url(abs_url)
528
 
        normalized_rel_url = urlutils.relative_url(norm_base, norm_abs_url)
529
 
        if normalized_rel_url == ".." or normalized_rel_url.startswith("../"):
530
 
            http_transport = self._http_transport.clone(normalized_rel_url)
531
 
        else:
532
 
            http_transport = self._http_transport
533
532
        return RemoteHTTPTransport(abs_url,
534
533
                                   _from_transport=self,
535
 
                                   http_transport=http_transport)
 
534
                                   http_transport=self._http_transport)
536
535
 
537
536
 
538
537
def get_test_permutations():