~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-13 03:56:23 UTC
  • mfrom: (4118.1.5 fix-stackable-remote-repo)
  • Revision ID: pqm@pqm.ubuntu.com-20090313035623-vn0615cs6bd6590e
(andrew) Fix performance regression (many small round-trips) when
        pushing to a remote pack, and improve some tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
def response_tuple_to_repo_format(response):
74
74
    """Convert a response tuple describing a repository format to a format."""
75
75
    format = RemoteRepositoryFormat()
76
 
    format.rich_root_data = (response[0] == 'yes')
77
 
    format.supports_tree_reference = (response[1] == 'yes')
78
 
    format.supports_external_lookups = (response[2] == 'yes')
 
76
    format._rich_root_data = (response[0] == 'yes')
 
77
    format._supports_tree_reference = (response[1] == 'yes')
 
78
    format._supports_external_lookups = (response[2] == 'yes')
79
79
    format._network_name = response[3]
80
80
    return format
81
81
 
412
412
        self._custom_format = None
413
413
        self._network_name = None
414
414
        self._creating_bzrdir = None
 
415
        self._supports_external_lookups = None
 
416
        self._supports_tree_reference = None
 
417
        self._rich_root_data = None
 
418
 
 
419
    @property
 
420
    def rich_root_data(self):
 
421
        if self._rich_root_data is None:
 
422
            self._ensure_real()
 
423
            self._rich_root_data = self._custom_format.rich_root_data
 
424
        return self._rich_root_data
 
425
 
 
426
    @property
 
427
    def supports_external_lookups(self):
 
428
        if self._supports_external_lookups is None:
 
429
            self._ensure_real()
 
430
            self._supports_external_lookups = \
 
431
                self._custom_format.supports_external_lookups 
 
432
        return self._supports_external_lookups
 
433
 
 
434
    @property
 
435
    def supports_tree_reference(self):
 
436
        if self._supports_tree_reference is None:
 
437
            self._ensure_real()
 
438
            self._supports_tree_reference = \
 
439
                self._custom_format.supports_tree_reference
 
440
        return self._supports_tree_reference
415
441
 
416
442
    def _vfs_initialize(self, a_bzrdir, shared):
417
443
        """Helper for common code in initialize."""
995
1021
 
996
1022
        :param repository: A repository.
997
1023
        """
998
 
        # XXX: At the moment the RemoteRepository will allow fallbacks
999
 
        # unconditionally - however, a _real_repository will usually exist,
1000
 
        # and may raise an error if it's not accommodated by the underlying
1001
 
        # format.  Eventually we should check when opening the repository
1002
 
        # whether it's willing to allow them or not.
1003
 
        #
 
1024
        if not self._format.supports_external_lookups:
 
1025
            raise errors.UnstackableRepositoryFormat(
 
1026
                self._format.network_name(), self.base)
1004
1027
        # We need to accumulate additional repositories here, to pass them in
1005
1028
        # on various RPC's.
1006
1029
        #