~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

[merge] bzr.log.plugins: add --log-format to 'bzr log', allow a default to be set in config

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
check_signatures=require|ignore|check-available(default)
28
28
create_signatures=always|never|when-required(default)
29
29
gpg_signing_command=name-of-program
 
30
log_format=name-of-format
30
31
 
31
32
in branches.conf, you specify the url of a branch and options for it.
32
33
Wildcards may be used - * and ? as normal in shell completion. Options
49
50
                    gpg signatures, never create them, or create them if the
50
51
                    branch is configured to require them.
51
52
                    NB: This option is planned, but not implemented yet.
 
53
log_format - This options set the default log format.  Options are long, 
 
54
             short, line, or a plugin can register new formats
52
55
"""
53
56
 
54
57
 
120
123
        """See gpg_signing_command()."""
121
124
        return None
122
125
 
 
126
    def log_format(self):
 
127
        """What log format should be used"""
 
128
        result = self._log_format()
 
129
        if result is None:
 
130
            result = "long"
 
131
        return result
 
132
 
 
133
    def _log_format(self):
 
134
        """See log_format()."""
 
135
        return None
 
136
 
123
137
    def __init__(self):
124
138
        super(Config, self).__init__()
125
139
 
226
240
        """See Config.gpg_signing_command."""
227
241
        return self._get_user_option('gpg_signing_command')
228
242
 
 
243
    def _log_format(self):
 
244
        """See Config.log_format."""
 
245
        return self._get_user_option('log_format')
 
246
 
229
247
    def __init__(self, get_filename):
230
248
        super(IniBasedConfig, self).__init__()
231
249
        self._get_filename = get_filename
318
336
            return command
319
337
        return self._get_global_config()._gpg_signing_command()
320
338
 
 
339
    def _log_format(self):
 
340
        """See Config.log_format."""
 
341
        command = super(LocationConfig, self)._log_format()
 
342
        if command is not None:
 
343
            return command
 
344
        return self._get_global_config()._log_format()
 
345
 
321
346
    def _get_user_id(self):
322
347
        user_id = super(LocationConfig, self)._get_user_id()
323
348
        if user_id is not None:
409
434
        """See Config.post_commit."""
410
435
        return self._get_location_config()._post_commit()
411
436
 
 
437
    def _log_format(self):
 
438
        """See Config.log_format."""
 
439
        return self._get_location_config()._log_format()
412
440
 
413
441
def ensure_config_dir_exists(path=None):
414
442
    """Make sure a configuration directory exists.