~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/controldir.py

  • Committer: Neil Martinsen-Burrell
  • Date: 2011-12-11 04:11:49 UTC
  • mto: This revision was merged to the branch mainline in revision 6356.
  • Revision ID: nmb@wartburg.edu-20111211041149-iina5f13plnhh065
implement list_branches in terms of 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
 
        try:
110
 
            return [self.open_branch()]
111
 
        except (errors.NotBranchError, errors.NoRepositoryPresent):
112
 
            return []
 
109
        return self.get_branches().values()
113
110
 
114
111
    def get_branches(self):
115
112
        """Return a dictionary with branch_names and branch objects."""
116
 
        branches = self.list_branches()
117
 
        if branches:
118
 
           return {None:branches[0]}
119
 
        else:
 
113
        try:
 
114
           return {None:self.open_branch()}
 
115
        except (errors.NotBranchError, errors.NoRepositoryPresent):
120
116
           return {}
121
117
 
122
118
    def is_control_filename(self, filename):