~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Robert Collins
  • Date: 2006-02-28 04:52:34 UTC
  • mfrom: (1583 +trunk)
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060228045234-d1856c4499648fb7
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
                    NB: This option is planned, but not implemented yet.
53
53
log_format - This options set the default log format.  Options are long, 
54
54
             short, line, or a plugin can register new formats
 
55
 
 
56
In bazaar.conf you can also define aliases in the ALIASES sections, example
 
57
 
 
58
[ALIASES]
 
59
lastlog=log --line -r-10..-1
 
60
ll=log --line -r-10..-1
 
61
h=help
 
62
up=pull
55
63
"""
56
64
 
57
65
 
191
199
            return True
192
200
        return False
193
201
 
 
202
    def get_alias(self, value):
 
203
        return self._get_alias(value)
 
204
 
 
205
    def _get_alias(self, value):
 
206
        pass
 
207
 
194
208
 
195
209
class IniBasedConfig(Config):
196
210
    """A configuration policy that draws from ini files."""
258
272
        raise errors.BzrError("Invalid signatures policy '%s'"
259
273
                              % signature_string)
260
274
 
 
275
    def _get_alias(self, value):
 
276
        try:
 
277
            return self._get_parser().get_value("ALIASES", 
 
278
                                                value)
 
279
        except KeyError:
 
280
            pass
 
281
 
261
282
 
262
283
class GlobalConfig(IniBasedConfig):
263
284
    """The configuration that should be used for a specific location."""
432
453
        """See Config.log_format."""
433
454
        return self._get_location_config()._log_format()
434
455
 
 
456
 
435
457
def ensure_config_dir_exists(path=None):
436
458
    """Make sure a configuration directory exists.
437
459
    This makes sure that the directory exists.