/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/branch.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:
768
768
        pattern is that the user can override it by specifying a
769
769
        location.
770
770
        """
771
 
        raise NotImplementedError(self.get_parent)
 
771
        parent = self._get_parent_location()
 
772
        if parent is None:
 
773
            return parent
 
774
        # This is an old-format absolute path to a local branch
 
775
        # turn it into a url
 
776
        if parent.startswith('/'):
 
777
            parent = urlutils.local_path_to_url(parent.decode('utf8'))
 
778
        try:
 
779
            return urlutils.join(self.base[:-1], parent)
 
780
        except errors.InvalidURLJoin, e:
 
781
            raise errors.InaccessibleParent(parent, self.base)
 
782
 
 
783
    def _get_parent_location(self):
 
784
        raise NotImplementedError(self._get_parent_location)
772
785
 
773
786
    def _set_config_location(self, name, url, config=None,
774
787
                             make_relative=False):
2081
2094
        result.new_revno, result.new_revid = target.last_revision_info()
2082
2095
        return result
2083
2096
 
2084
 
    def get_parent(self):
2085
 
        """See Branch.get_parent."""
2086
 
        parent = self._get_parent_location()
2087
 
        if parent is None:
2088
 
            return parent
2089
 
        # This is an old-format absolute path to a local branch
2090
 
        # turn it into a url
2091
 
        if parent.startswith('/'):
2092
 
            parent = urlutils.local_path_to_url(parent.decode('utf8'))
2093
 
        try:
2094
 
            return urlutils.join(self.base[:-1], parent)
2095
 
        except errors.InvalidURLJoin, e:
2096
 
            raise errors.InaccessibleParent(parent, self.base)
2097
 
 
2098
2097
    def get_stacked_on_url(self):
2099
2098
        raise errors.UnstackableBranchFormat(self._format, self.base)
2100
2099