~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-22 19:54:56 UTC
  • mto: This revision was merged to the branch mainline in revision 6408.
  • Revision ID: jelmer@samba.org-20111222195456-eqsv7yqkv3m9epl8
Use update_feature_flags everywhere.

Show diffs side-by-side

added added

removed removed

Lines of Context:
794
794
        """
795
795
        self.control_files.lock_write()
796
796
        try:
797
 
            for name, necessity in updated_flags.iteritems():
798
 
                if necessity is None:
799
 
                    try:
800
 
                        del self._format.features[name]
801
 
                    except KeyError:
802
 
                        pass
803
 
                else:
804
 
                    self._format.features[name] = necessity
 
797
            self._format._update_feature_flags(updated_flags)
805
798
            self.transport.put_bytes('branch-format', self._format.as_string())
806
799
        finally:
807
800
            self.control_files.unlock()
1233
1226
        return (self.__class__ is other.__class__ and
1234
1227
                self.features == other.features)
1235
1228
 
 
1229
    def _update_feature_flags(self, updated_flags):
 
1230
        """Update the feature flags in this format.
 
1231
 
 
1232
        :param updated_flags: Updated feature flags
 
1233
        """
 
1234
        for name, necessity in updated_flags.iteritems():
 
1235
            if necessity is None:
 
1236
                try:
 
1237
                    del self.features[name]
 
1238
                except KeyError:
 
1239
                    pass
 
1240
            else:
 
1241
                self.features[name] = necessity
 
1242
 
1236
1243
 
1237
1244
class BzrProber(controldir.Prober):
1238
1245
    """Prober for formats that use a .bzr/ control directory."""