/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

Refactor config dir check.

* bzrlib/tests/test_config.py:
(TestLockableConfig.create_config)
(TestLocationConfig.get_branch_config)
(TestBranchConfigItems.get_branch_config): Delete useless call.

* bzrlib/config.py:
(IniBasedConfig._write_config_file): Ensure the config dir exist.
(GlobalConfig._set_option, LocationConfig.set_user_option):
Delegate config dir check to _write_config_file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
417
417
        self.config = self.create_config(self._content)
418
418
 
419
419
    def create_config(self, content):
420
 
        config.ensure_config_dir_exists()
421
420
        c = self.config_class(_content=content)
422
421
        c._write_config_file()
423
422
        return c
1012
1011
        if global_config is None:
1013
1012
            global_config = sample_config_text
1014
1013
 
1015
 
        config.ensure_config_dir_exists()
1016
1014
        my_global_config = config.GlobalConfig(_content=global_config)
1017
1015
        my_global_config._write_config_file()
1018
1016
        my_location_config = config.LocationConfig(
1090
1088
        my_branch = FakeBranch(location)
1091
1089
        if global_config is not None:
1092
1090
            my_global_config = config.GlobalConfig(_content=global_config)
1093
 
            config.ensure_config_dir_exists()
1094
1091
            my_global_config._write_config_file()
1095
1092
        if location_config is not None:
1096
1093
            my_location_config = config.LocationConfig(my_branch.base,
1097
1094
                                                       _content=location_config)
1098
 
            config.ensure_config_dir_exists()
1099
1095
            my_location_config._write_config_file()
1100
1096
        my_config = config.BranchConfig(my_branch)
1101
1097
        if branch_data_config is not None: