~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Martin Pool
  • Date: 2010-08-13 07:56:06 UTC
  • mfrom: (5050.17.4 2.2)
  • mto: (5050.17.6 2.2)
  • mto: This revision was merged to the branch mainline in revision 5379.
  • Revision ID: mbp@sourcefrog.net-20100813075606-8zgmov3ezwans2zo
merge bzr 2.2

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):