~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Vincent Ladeuil
  • Date: 2011-08-09 16:51:13 UTC
  • mto: This revision was merged to the branch mainline in revision 6072.
  • Revision ID: v.ladeuil+lp@free.fr-20110809165113-wqv8cfyok73qcgkv
Provide per-config option help

Show diffs side-by-side

added added

removed removed

Lines of Context:
2282
2282
    def get_default(self):
2283
2283
        return self.default
2284
2284
 
 
2285
    def get_help_text(self, additional_see_also=None, plain=True):
 
2286
        result = self.help
 
2287
        from bzrlib import help_topics
 
2288
        result += help_topics._format_see_also(additional_see_also)
 
2289
        if plain:
 
2290
            result = help_topics.help_as_plain_text(result)
 
2291
        return result
 
2292
 
2285
2293
 
2286
2294
class OptionRegistry(registry.Registry):
2287
2295
    """Register config options by their name.
2301
2309
    def register_lazy(self, key, module_name, member_name):
2302
2310
        """Register a new option to be loaded on request.
2303
2311
 
2304
 
        :param key: This is the key to use to request the option later. Since
2305
 
            the registration is lazy, it should be provided and match the
2306
 
            option name.
2307
 
 
2308
 
        :param module_name: The python path to the module. Such as 'os.path'.
2309
 
 
2310
 
        :param member_name: The member of the module to return.  If empty or
 
2312
        :param key: the key to request the option later. Since the registration
 
2313
            is lazy, it should be provided and match the option name.
 
2314
 
 
2315
        :param module_name: the python path to the module. Such as 'os.path'.
 
2316
 
 
2317
        :param member_name: the member of the module to return.  If empty or 
2311
2318
                None, get() will return the module itself.
2312
2319
        """
2313
2320
        super(OptionRegistry, self).register_lazy(key,
2329
2336
 
2330
2337
option_registry.register(
2331
2338
    Option('dirstate.fdatasync', default=True,
2332
 
           help='''
 
2339
           help='''\
2333
2340
Flush dirstate changes onto physical disk?
2334
2341
 
2335
2342
If true (default), working tree metadata changes are flushed through the