/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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-15 08:20:33 UTC
  • mfrom: (4288.1.12 push.roundtrips)
  • Revision ID: pqm@pqm.ubuntu.com-20090415082033-tds4zs962x6kwc2c
(robertc) Add a Branch.set_parent_location verb and reduce lock
        churning to reduce network round trips. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1961
1961
        except (errors.NotStacked, errors.UnstackableBranchFormat,
1962
1962
            errors.UnstackableRepositoryFormat), e:
1963
1963
            return
1964
 
        self._activate_fallback_location(fallback_url)
 
1964
        self._activate_fallback_location(fallback_url, None)
1965
1965
 
1966
1966
    def _get_config(self):
1967
1967
        return RemoteBranchConfig(self)
2301
2301
        return self._real_branch._get_parent_location()
2302
2302
 
2303
2303
    def _set_parent_location(self, url):
 
2304
        medium = self._client._medium
 
2305
        if medium._is_remote_before((1, 15)):
 
2306
            return self._vfs_set_parent_location(url)
 
2307
        try:
 
2308
            call_url = url or ''
 
2309
            if type(call_url) is not str:
 
2310
                raise AssertionError('url must be a str or None (%s)' % url)
 
2311
            response = self._call('Branch.set_parent_location',
 
2312
                self._remote_path(), self._lock_token, self._repo_lock_token,
 
2313
                call_url)
 
2314
        except errors.UnknownSmartMethod:
 
2315
            medium._remember_remote_is_before((1, 15))
 
2316
            return self._vfs_set_parent_location(url)
 
2317
        if response != ():
 
2318
            raise errors.UnexpectedSmartServerResponse(response)
 
2319
 
 
2320
    def _vfs_set_parent_location(self, url):
2304
2321
        self._ensure_real()
2305
2322
        return self._real_branch._set_parent_location(url)
2306
2323