~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/controldir.py

(Neil Martinsen-Burrell) Add ControlDir.get_branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        """Return a sequence of all branches local to this control directory.
107
107
 
108
108
        """
 
109
        return self.get_branches().values()
 
110
 
 
111
    def get_branches(self):
 
112
        """Get all branches in this control directory, as a dictionary.
 
113
        
 
114
        :return: Dictionary mapping branch names to instances.
 
115
        """
109
116
        try:
110
 
            return [self.open_branch()]
 
117
           return { None: self.open_branch() }
111
118
        except (errors.NotBranchError, errors.NoRepositoryPresent):
112
 
            return []
 
119
           return {}
113
120
 
114
121
    def is_control_filename(self, filename):
115
122
        """True if filename is the name of a path which is reserved for