~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

Merge sftp-leaks into catch-them-all

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
 
75
75
import bzrlib
76
76
from bzrlib import (
 
77
    atomicfile,
77
78
    debug,
78
79
    errors,
79
80
    mail_client,
478
479
        return self.get_user_option('nickname')
479
480
 
480
481
    def _write_config_file(self):
481
 
        f = file(self._get_filename(), "wb")
482
 
        try:
483
 
            osutils.copy_ownership_from_path(f.name)
484
 
            self._get_parser().write(f)
485
 
        finally:
486
 
            f.close()
 
482
        filename = self._get_filename()
 
483
        atomic_file = atomicfile.AtomicFile(filename)
 
484
        self._get_parser().write(atomic_file)
 
485
        atomic_file.commit()
 
486
        atomic_file.close()
 
487
        osutils.copy_ownership_from_path(filename)
487
488
 
488
489
 
489
490
class GlobalConfig(IniBasedConfig):