/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 breezy/controldir.py

  • Committer: Jelmer Vernooij
  • Date: 2020-05-06 02:13:25 UTC
  • mfrom: (7490.7.21 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200506021325-awbmmqu1zyorz7sj
Merge 3.1 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
        """
128
128
        return list(self.get_branches().values())
129
129
 
 
130
    def branch_names(self):
 
131
        """List all branch names in this control directory.
 
132
 
 
133
        :return: List of branch names
 
134
        """
 
135
        try:
 
136
            self.get_branch_reference()
 
137
        except (errors.NotBranchError, errors.NoRepositoryPresent):
 
138
            return []
 
139
        else:
 
140
            return [""]
 
141
 
130
142
    def get_branches(self):
131
143
        """Get all branches in this control directory, as a dictionary.
132
144
 
794
806
            a_transport = new_t
795
807
 
796
808
    @classmethod
797
 
    def open_tree_or_branch(klass, location):
 
809
    def open_tree_or_branch(klass, location, name=None):
798
810
        """Return the branch and working tree at a location.
799
811
 
800
812
        If there is no tree at the location, tree will be None.
803
815
        :return: (tree, branch)
804
816
        """
805
817
        controldir = klass.open(location)
806
 
        return controldir._get_tree_branch()
 
818
        return controldir._get_tree_branch(name=name)
807
819
 
808
820
    @classmethod
809
821
    def open_containing_tree_or_branch(klass, location,