~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-16 09:33:16 UTC
  • mfrom: (6059.3.6 747050-config-help)
  • Revision ID: pqm@pqm.ubuntu.com-20110816093316-favbhalxcbqwxhuw
(vila) Implement per-config option help (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2307
2307
    def get_default(self):
2308
2308
        return self.default
2309
2309
 
 
2310
    def get_help_text(self, additional_see_also=None, plain=True):
 
2311
        result = self.help
 
2312
        from bzrlib import help_topics
 
2313
        result += help_topics._format_see_also(additional_see_also)
 
2314
        if plain:
 
2315
            result = help_topics.help_as_plain_text(result)
 
2316
        return result
 
2317
 
 
2318
 
2310
2319
# Predefined converters to get proper values from store
2311
2320
 
2312
2321
def bool_from_store(unicode_str):
2351
2360
    def register_lazy(self, key, module_name, member_name):
2352
2361
        """Register a new option to be loaded on request.
2353
2362
 
2354
 
        :param key: This is the key to use to request the option later. Since
2355
 
            the registration is lazy, it should be provided and match the
2356
 
            option name.
2357
 
 
2358
 
        :param module_name: The python path to the module. Such as 'os.path'.
2359
 
 
2360
 
        :param member_name: The member of the module to return.  If empty or
 
2363
        :param key: the key to request the option later. Since the registration
 
2364
            is lazy, it should be provided and match the option name.
 
2365
 
 
2366
        :param module_name: the python path to the module. Such as 'os.path'.
 
2367
 
 
2368
        :param member_name: the member of the module to return.  If empty or 
2361
2369
                None, get() will return the module itself.
2362
2370
        """
2363
2371
        super(OptionRegistry, self).register_lazy(key,
2379
2387
 
2380
2388
option_registry.register(
2381
2389
    Option('dirstate.fdatasync', default=True, from_unicode=bool_from_store,
2382
 
           help='''
 
2390
           help='''\
2383
2391
Flush dirstate changes onto physical disk?
2384
2392
 
2385
2393
If true (default), working tree metadata changes are flushed through the