~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Martin Pool
  • Date: 2010-04-28 07:03:38 UTC
  • mfrom: (5188 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5189.
  • Revision ID: mbp@sourcefrog.net-20100428070338-2af8y3takgfkrkyp
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
            interpreted as a boolean. Returns True or False otherwise.
194
194
        """
195
195
        s = self._get_user_option(option_name)
196
 
        return ui.bool_from_string(s)
 
196
        if s is None:
 
197
            # The option doesn't exist
 
198
            return None
 
199
        val = ui.bool_from_string(s)
 
200
        if val is None:
 
201
            # The value can't be interpreted as a boolean
 
202
            trace.warning('Value "%s" is not a boolean for "%s"',
 
203
                          s, option_name)
 
204
        return val
197
205
 
198
206
    def get_user_option_as_list(self, option_name):
199
207
        """Get a generic option as a list - no special process, no default.
511
519
 
512
520
    def _write_config_file(self):
513
521
        path = self._get_filename()
514
 
        f = osutils.open_with_ownership(path, 'wb')
 
522
        f = open(path, 'wb')
 
523
        osutils.copy_ownership_from_path(path)
515
524
        self._get_parser().write(f)
516
525
        f.close()
517
526
 
810
819
                trace.mutter('creating config parent directory: %r', parent_dir)
811
820
            os.mkdir(parent_dir)
812
821
        trace.mutter('creating config directory: %r', path)
813
 
        osutils.mkdir_with_ownership(path)
 
822
        os.mkdir(path)
 
823
        osutils.copy_ownership_from_path(path)
814
824
 
815
825
 
816
826
def config_dir():
1407
1417
 
1408
1418
 
1409
1419
class PlainTextCredentialStore(CredentialStore):
1410
 
    """Plain text credential store for the authentication.conf file."""
 
1420
    __doc__ = """Plain text credential store for the authentication.conf file"""
1411
1421
 
1412
1422
    def decode_password(self, credentials):
1413
1423
        """See CredentialStore.decode_password."""