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

Set branch config options via a smart method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2389
2389
        return section_obj.get(name, default)
2390
2390
 
2391
2391
    def _get_configobj(self):
2392
 
        path = self._branch.bzrdir._path_for_remote_call(
2393
 
            self._branch._client)
 
2392
        path = self._branch._remote_path()
2394
2393
        response = self._branch._client.call_expecting_body(
2395
2394
            'Branch.get_config_file', path)
2396
2395
        if response[0][0] != 'ok':
2405
2404
        :param name: The name of the value to set
2406
2405
        :param section: The section the option is in (if any)
2407
2406
        """
2408
 
        return self._vfs_set_option(value, name, section)
 
2407
        medium = self._branch._client._medium
 
2408
        if medium._is_remote_before((1, 14)):
 
2409
            return self._vfs_set_option(value, name, section)
 
2410
        try:
 
2411
            path = self._branch._remote_path()
 
2412
            response = self._branch._client.call('Branch.set_config_option',
 
2413
                path, self._branch._lock_token, self._branch._repo_lock_token,
 
2414
                value, name, section or '')
 
2415
        except errors.UnknownSmartMethod:
 
2416
            medium._remember_remote_is_before((1, 14))
 
2417
            return self._vfs_set_option(value, name, section)
 
2418
        if response != ():
 
2419
            raise errors.UnexpectedSmartServerResponse(response)
2409
2420
 
2410
2421
    def _vfs_set_option(self, value, name, section=None):
2411
2422
        self._branch._ensure_real()