~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

``.bazaar``, ``.bazaar/bazaar.conf`` and ``.bzr.log`` inherit user and group ownership from the containing directory. This allow bzr to work better with sudo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
510
510
        self._write_config_file()
511
511
 
512
512
    def _write_config_file(self):
513
 
        f = open(self._get_filename(), 'wb')
 
513
        path = self._get_filename()
 
514
        f = osutils.open_with_ownership(path, 'wb')
514
515
        self._get_parser().write(f)
515
516
        f.close()
516
517
 
809
810
                trace.mutter('creating config parent directory: %r', parent_dir)
810
811
            os.mkdir(parent_dir)
811
812
        trace.mutter('creating config directory: %r', path)
812
 
        os.mkdir(path)
 
813
        osutils.mkdir_with_ownership(path)
813
814
 
814
815
 
815
816
def config_dir():