/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-03-05 05:26:24 UTC
  • mto: (4083.1.3 robert-rollup)
  • mto: This revision was merged to the branch mainline in revision 4084.
  • Revision ID: robertc@robertcollins.net-20090305052624-ejso9br8bxv68twx
Add a Branch.get_parent remote call for RemoteBranch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2030
2030
            hook(self, rev_history)
2031
2031
        self._cache_revision_history(rev_history)
2032
2032
 
2033
 
    def get_parent(self):
 
2033
    def _get_parent_location(self):
 
2034
        medium = self._client._medium
 
2035
        if medium._is_remote_before((1, 13)):
 
2036
            return self._vfs_get_parent_location()
 
2037
        try:
 
2038
            response = self._call('Branch.get_parent',
 
2039
                self._remote_path())
 
2040
        except errors.UnknownSmartMethod:
 
2041
            return self._vfs_get_parent_location()
 
2042
        if not response:
 
2043
            return None
 
2044
        return response
 
2045
 
 
2046
    def _vfs_get_parent_location(self):
2034
2047
        self._ensure_real()
2035
2048
        return self._real_branch.get_parent()
2036
2049
 
2037
 
    def _get_parent_location(self):
2038
 
        # Used by tests, when checking normalisation of given vs stored paths.
2039
 
        self._ensure_real()
2040
 
        return self._real_branch._get_parent_location()
2041
 
 
2042
2050
    def set_parent(self, url):
2043
2051
        self._ensure_real()
2044
2052
        return self._real_branch.set_parent(url)