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

  • Committer: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
737
737
            raise errors.NoRepositoryPresent(self)
738
738
        return found_repo
739
739
 
740
 
    def get_branch_reference(self, name=None):
 
740
    def get_branch_reference(self):
741
741
        """Return the referenced URL for the branch in this bzrdir.
742
742
 
743
 
        :param name: Optional colocated branch name
744
743
        :raises NotBranchError: If there is no Branch.
745
 
        :raises NoColocatedBranchSupport: If a branch name was specified
746
 
            but colocated branches are not supported.
747
744
        :return: The URL the branch in this bzrdir references if it is a
748
745
            reference branch, or None for regular branches.
749
746
        """
750
 
        if name is not None:
751
 
            raise errors.NoColocatedBranchSupport(self)
752
747
        return None
753
748
 
754
749
    def get_branch_transport(self, branch_format, name=None):
999
994
                raise errors.NotBranchError(path=url)
1000
995
            a_transport = new_t
1001
996
 
1002
 
    def _get_tree_branch(self, name=None):
 
997
    def _get_tree_branch(self):
1003
998
        """Return the branch and tree, if any, for this bzrdir.
1004
999
 
1005
 
        :param name: Name of colocated branch to open.
1006
 
 
1007
1000
        Return None for tree if not present or inaccessible.
1008
1001
        Raise NotBranchError if no branch is present.
1009
1002
        :return: (tree, branch)
1012
1005
            tree = self.open_workingtree()
1013
1006
        except (errors.NoWorkingTree, errors.NotLocalUrl):
1014
1007
            tree = None
1015
 
            branch = self.open_branch(name=name)
 
1008
            branch = self.open_branch()
1016
1009
        else:
1017
 
            if name is not None:
1018
 
                branch = self.open_branch(name=name)
1019
 
            else:
1020
 
                branch = tree.branch
 
1010
            branch = tree.branch
1021
1011
        return tree, branch
1022
1012
 
1023
1013
    @classmethod
1746
1736
    def destroy_workingtree_metadata(self):
1747
1737
        self.transport.delete_tree('checkout')
1748
1738
 
1749
 
    def find_branch_format(self, name=None):
 
1739
    def find_branch_format(self):
1750
1740
        """Find the branch 'format' for this bzrdir.
1751
1741
 
1752
1742
        This might be a synthetic object for e.g. RemoteBranch and SVN.
1753
1743
        """
1754
1744
        from bzrlib.branch import BranchFormat
1755
 
        return BranchFormat.find_format(self, name=name)
 
1745
        return BranchFormat.find_format(self)
1756
1746
 
1757
1747
    def _get_mkdir_mode(self):
1758
1748
        """Figure out the mode to use when creating a bzrdir subdir."""
1760
1750
                                     lockable_files.TransportLock)
1761
1751
        return temp_control._dir_mode
1762
1752
 
1763
 
    def get_branch_reference(self, name=None):
 
1753
    def get_branch_reference(self):
1764
1754
        """See BzrDir.get_branch_reference()."""
1765
1755
        from bzrlib.branch import BranchFormat
1766
 
        format = BranchFormat.find_format(self, name=name)
1767
 
        return format.get_reference(self, name=name)
 
1756
        format = BranchFormat.find_format(self)
 
1757
        return format.get_reference(self)
1768
1758
 
1769
1759
    def get_branch_transport(self, branch_format, name=None):
1770
1760
        """See BzrDir.get_branch_transport()."""
1864
1854
    def open_branch(self, name=None, unsupported=False,
1865
1855
                    ignore_fallbacks=False):
1866
1856
        """See BzrDir.open_branch."""
1867
 
        format = self.find_branch_format(name=name)
 
1857
        format = self.find_branch_format()
1868
1858
        self._check_supported(format, unsupported)
1869
1859
        return format.open(self, name=name,
1870
1860
            _found=True, ignore_fallbacks=ignore_fallbacks)