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

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 00:52:08 UTC
  • mfrom: (6675 work)
  • mto: (6670.4.8 move-bzr)
  • mto: This revision was merged to the branch mainline in revision 6681.
  • Revision ID: jelmer@jelmer.uk-20170610005208-dthx80fkolfpsenj
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1722
1722
             certificate should be verified, False otherwise.
1723
1723
        """
1724
1724
        credentials = None
1725
 
        for auth_def_name, auth_def in self._get_config().items():
 
1725
        for auth_def_name, auth_def in self._get_config().iteritems():
1726
1726
            if not isinstance(auth_def, configobj.Section):
1727
1727
                raise ValueError("%s defined outside a section" % auth_def_name)
1728
1728
 
1824
1824
            values['realm'] = realm
1825
1825
        config = self._get_config()
1826
1826
        for_deletion = []
1827
 
        for section, existing_values in config.items():
 
1827
        for section, existing_values in config.iteritems():
1828
1828
            for key in ('scheme', 'host', 'port', 'path', 'realm'):
1829
1829
                if existing_values.get(key) != values.get(key):
1830
1830
                    break
2854
2854
        return self.options.get(name, default)
2855
2855
 
2856
2856
    def iter_option_names(self):
2857
 
        for k in self.options.iterkeys():
 
2857
        for k in self.options.keys():
2858
2858
            yield k
2859
2859
 
2860
2860
    def __repr__(self):
2901
2901
 
2902
2902
        :param store: the store containing the section
2903
2903
        """
2904
 
        for k, expected in dirty.orig.iteritems():
 
2904
        for k, expected in dirty.orig.items():
2905
2905
            actual = dirty.get(k, _DeletedOption)
2906
2906
            reloaded = self.get(k, _NewlyCreatedOption)
2907
2907
            if actual is _DeletedOption:
3009
3009
        # get_mutable_section() call below.
3010
3010
        self.unload()
3011
3011
        # Apply the changes from the preserved dirty sections
3012
 
        for section_id, dirty in dirty_sections.iteritems():
 
3012
        for section_id, dirty in dirty_sections.items():
3013
3013
            clean = self.get_mutable_section(section_id)
3014
3014
            clean.apply_changes(dirty, self)
3015
3015
        # Everything is clean now
3153
3153
        if not self._need_saving():
3154
3154
            return
3155
3155
        # Preserve the current version
3156
 
        dirty_sections = dict(self.dirty_sections.items())
 
3156
        dirty_sections = self.dirty_sections.copy()
3157
3157
        self.apply_changes(dirty_sections)
3158
3158
        # Save to the persistent storage
3159
3159
        self.save()
3780
3780
            global _shared_stores_at_exit_installed
3781
3781
            stores = _shared_stores
3782
3782
            def save_config_changes():
3783
 
                for k, store in stores.items():
 
3783
                for k, store in stores.iteritems():
3784
3784
                    store.save_changes()
3785
3785
            if not _shared_stores_at_exit_installed:
3786
3786
                # FIXME: Ugly hack waiting for library_state to always be