~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Gary van der Merwe
  • Date: 2010-07-28 08:34:25 UTC
  • mfrom: (5050.3.15 2.2)
  • mto: (5050.3.19 2.2)
  • mto: This revision was merged to the branch mainline in revision 5371.
  • Revision ID: garyvdm@gmail.com-20100728083425-al2e9wj5w3wiw39n
MergeĀ lp: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):