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

  • Committer: Martin
  • Date: 2017-06-05 20:48:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6658.
  • Revision ID: gzlist@googlemail.com-20170605204831-20accykspjcrx0a8
Apply 2to3 dict fixer and clean up resulting mess using view helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
 
144
144
    def _check_prefix_uniqueness(self):
145
145
        """Ensure that the index collection is able to differentiate safely."""
146
 
        prefixes = {}
 
146
        prefixes = set()
147
147
        for index in self.search_path:
148
 
            prefixes.setdefault(index.prefix, []).append(index)
149
 
        for prefix, indices in prefixes.items():
150
 
            if len(indices) > 1:
 
148
            prefix = index.prefix
 
149
            if prefix in prefixes:
151
150
                raise errors.DuplicateHelpPrefix(prefix)
 
151
            prefixes.add(prefix)
152
152
 
153
153
    def search(self, topic):
154
154
        """Search for topic across the help search path.