~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Erik Bågfors
  • Date: 2006-02-04 11:36:23 UTC
  • mto: (1185.50.77 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: erik@bagfors.nu-20060204113623-016da21eeb5723ca
Support for setting the default log format at a configuration option
Also, removed the possibility for plugins to set the default formatter

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_formatter(self):
 
127
        """What log formatter should be used"""
 
128
        result = self._log_formatter()
 
129
        if result is None:
 
130
            result = "long"
 
131
        mutter('debug ' + result)
 
132
 
 
133
        return result
 
134
 
 
135
    def _log_formatter(self):
 
136
        """See log_formatter()."""
 
137
        mutter('debug2 ')
 
138
        return None
 
139
 
123
140
    def __init__(self):
124
141
        super(Config, self).__init__()
125
142
 
226
243
        """See Config.gpg_signing_command."""
227
244
        return self._get_user_option('gpg_signing_command')
228
245
 
 
246
    def _log_formatter(self):
 
247
        """See Config.log_formatter."""
 
248
        mutter('debug3 ')
 
249
        return self._get_user_option('log_formatter')
 
250
 
229
251
    def __init__(self, get_filename):
230
252
        super(IniBasedConfig, self).__init__()
231
253
        self._get_filename = get_filename
318
340
            return command
319
341
        return self._get_global_config()._gpg_signing_command()
320
342
 
 
343
    def _log_formatter(self):
 
344
        """See Config.log_formatter."""
 
345
        command = super(LocationConfig, self)._log_formatter()
 
346
        if command is not None:
 
347
            return command
 
348
        return self._get_global_config()._log_formatter()
 
349
 
321
350
    def _get_user_id(self):
322
351
        user_id = super(LocationConfig, self)._get_user_id()
323
352
        if user_id is not None:
409
438
        """See Config.post_commit."""
410
439
        return self._get_location_config()._post_commit()
411
440
 
 
441
    def _log_formatter(self):
 
442
        """See Config.log_formatter."""
 
443
        return self._get_location_config()._log_formatter()
412
444
 
413
445
def ensure_config_dir_exists(path=None):
414
446
    """Make sure a configuration directory exists.