/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: Robert Collins
  • Date: 2009-04-15 02:07:35 UTC
  • mto: This revision was merged to the branch mainline in revision 4292.
  • Revision ID: robertc@robertcollins.net-20090415020735-poizrhi1b98mtdgk
Add new remote server verb Branch.set_parent_location, dropping roundtrips further on push operations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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