~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-09 04:17:50 UTC
  • mto: This revision was merged to the branch mainline in revision 6356.
  • Revision ID: nmb@wartburg.edu-20111209041750-amismw2as944epjj
add get_branches method to return a dictionary of names and branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
        except (errors.NotBranchError, errors.NoRepositoryPresent):
112
112
            return []
113
113
 
 
114
    def get_branches(self):
 
115
        """Return a dictionary with branch_names and branch objects."""
 
116
        branches = self.list_branches()
 
117
        if branches:
 
118
           return {None:branches[0]}
 
119
        else:
 
120
           return {}
 
121
 
114
122
    def is_control_filename(self, filename):
115
123
        """True if filename is the name of a path which is reserved for
116
124
        controldirs.