~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

(jelmer) Add HPSS call for ``BzrDir.checkout_metadir``. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
490
490
        self._next_open_branch_result = None
491
491
        return _mod_bzrdir.BzrDir.break_lock(self)
492
492
 
 
493
    def _vfs_checkout_metadir(self):
 
494
        self._ensure_real()
 
495
        return self._real_bzrdir.checkout_metadir()
 
496
 
 
497
    def checkout_metadir(self):
 
498
        """Retrieve the controldir format to use for checkouts of this one.
 
499
        """
 
500
        medium = self._client._medium
 
501
        if medium._is_remote_before((2, 5)):
 
502
            return self._vfs_checkout_metadir()
 
503
        path = self._path_for_remote_call(self._client)
 
504
        try:
 
505
            response = self._client.call('BzrDir.checkout_metadir',
 
506
                path)
 
507
        except errors.UnknownSmartMethod:
 
508
            medium._remember_remote_is_before((2, 5))
 
509
            return self._vfs_checkout_metadir()
 
510
        if len(response) != 3:
 
511
            raise errors.UnexpectedSmartServerResponse(response)
 
512
        control_name, repo_name, branch_name = response
 
513
        try:
 
514
            format = controldir.network_format_registry.get(control_name)
 
515
        except KeyError:
 
516
            raise errors.UnknownFormatError(kind='control',
 
517
                format=control_name)
 
518
        if repo_name:
 
519
            try:
 
520
                repo_format = _mod_repository.network_format_registry.get(
 
521
                    repo_name)
 
522
            except KeyError:
 
523
                raise errors.UnknownFormatError(kind='repository',
 
524
                    format=repo_name)
 
525
            format.repository_format = repo_format
 
526
        if branch_name:
 
527
            try:
 
528
                format.set_branch_format(
 
529
                    branch.network_format_registry.get(branch_name))
 
530
            except KeyError:
 
531
                raise errors.UnknownFormatError(kind='branch',
 
532
                    format=branch_name)
 
533
        return format
 
534
 
493
535
    def _vfs_cloning_metadir(self, require_stacking=False):
494
536
        self._ensure_real()
495
537
        return self._real_bzrdir.cloning_metadir(
3179
3221
                self.bzrdir, self._client)
3180
3222
        return self._control_files
3181
3223
 
3182
 
    def _get_checkout_format(self, lightweight=False):
3183
 
        self._ensure_real()
3184
 
        if lightweight:
3185
 
            format = RemoteBzrDirFormat()
3186
 
            self.bzrdir._format._supply_sub_formats_to(format)
3187
 
            format.workingtree_format = self._real_branch._get_checkout_format(
3188
 
                lightweight=lightweight).workingtree_format
3189
 
            return format
3190
 
        else:
3191
 
            return self._real_branch._get_checkout_format(lightweight=False)
3192
 
 
3193
3224
    def get_physical_lock_status(self):
3194
3225
        """See Branch.get_physical_lock_status()."""
3195
3226
        try: