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

  • Committer: Vincent Ladeuil
  • Date: 2011-12-22 16:53:39 UTC
  • mto: This revision was merged to the branch mainline in revision 6437.
  • Revision ID: v.ladeuil+lp@free.fr-20111222165339-i1da5m6pa96nmjjj
Always return the no-name section if present.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3359
3359
        self.location = location
3360
3360
 
3361
3361
    def get_sections(self):
3362
 
        """Get all sections matching ``location``."""
 
3362
        """Get all sections matching ``location`` in the store.
 
3363
 
 
3364
        The most generic sections are described first in the store, then more
 
3365
        specific ones can be provided for reduced scopes.
 
3366
 
 
3367
        The returned section are therefore returned in the reversed order so
 
3368
        the most specific ones can be found first.
 
3369
        """
3363
3370
        store = self.store
3364
3371
        sections = []
3365
3372
        # Later sections are more specific, they should be returned first
3366
3373
        for _, section in reversed(list(store.get_sections())):
 
3374
            if section.id is None:
 
3375
                # The no-name section is always included if present
 
3376
                yield store, LocationSection(section, self.location)
 
3377
                continue
3367
3378
            section_path = section.id
3368
3379
            if section_path.startswith('file://'):
3369
3380
                section_path = urlutils.local_path_from_url(section)