/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/config.py

  • Committer: Aaron Bentley
  • Date: 2006-06-16 15:59:24 UTC
  • mto: This revision was merged to the branch mainline in revision 1787.
  • Revision ID: abentley@panoramicfeedback.com-20060616155924-893f31f8078a90df
Rename branches.conf to locations.conf

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Configuration that affects the behaviour of Bazaar.
19
19
 
20
20
Currently this configuration resides in ~/.bazaar/bazaar.conf
21
 
and ~/.bazaar/branches.conf, which is written to by bzr.
 
21
and ~/.bazaar/locations.conf, which is written to by bzr.
22
22
 
23
23
In bazaar.conf the following options may be set:
24
24
[DEFAULT]
29
29
gpg_signing_command=name-of-program
30
30
log_format=name-of-format
31
31
 
32
 
in branches.conf, you specify the url of a branch and options for it.
 
32
in locations.conf, you specify the url of a branch and options for it.
33
33
Wildcards may be used - * and ? as normal in shell completion. Options
34
 
set in both bazaar.conf and branches.conf are overridden by the branches.conf
 
34
set in both bazaar.conf and locations.conf are overridden by the locations.conf
35
35
setting.
36
36
[/home/robertc/source]
37
37
recurse=False|True(default)
333
333
    """A configuration object that gives the policy for a location."""
334
334
 
335
335
    def __init__(self, location):
336
 
        super(LocationConfig, self).__init__(branches_config_filename)
 
336
        name_generator = locations_config_filename
 
337
        if (not os.path.exists(name_generator()) and 
 
338
                os.path.exists(branches_config_filename())):
 
339
            warning('Please rename branches.conf to locations.conf')
 
340
            name_generator = branches_config_filename
 
341
        super(LocationConfig, self).__init__(name_generator)
337
342
        self._global_config = None
338
343
        self.location = location
339
344
 
435
440
    def set_user_option(self, option, value):
436
441
        """Save option and its value in the configuration."""
437
442
        # FIXME: RBC 20051029 This should refresh the parser and also take a
438
 
        # file lock on branches.conf.
 
443
        # file lock on locations.conf.
439
444
        conf_dir = os.path.dirname(self._get_filename())
440
445
        ensure_config_dir_exists(conf_dir)
441
446
        location = self.location
554
559
    """Return per-user configuration ini file filename."""
555
560
    return pathjoin(config_dir(), 'branches.conf')
556
561
 
 
562
def locations_config_filename():
 
563
    """Return per-user configuration ini file filename."""
 
564
    return pathjoin(config_dir(), 'locations.conf')
 
565
 
557
566
 
558
567
def _auto_user_id():
559
568
    """Calculate automatic user identification.