1
# Copyright (C) 2006-2010 Canonical Ltd
1
# Copyright (C) 2006-2011 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
65
65
:param section: Section in reference manual - see SECT_* identifiers.
67
67
# The detail is stored as the 'object' and the metadata as the info
68
info=(summary,section)
68
info = (summary, section)
69
69
super(HelpTopicRegistry, self).register(topic, detail, info=info)
71
71
def register_lazy(self, topic, module_name, member_name, summary,
79
79
:param section: Section in reference manual - see SECT_* identifiers.
81
81
# The detail is stored as the 'object' and the metadata as the info
82
info=(summary,section)
82
info = (summary, section)
83
83
super(HelpTopicRegistry, self).register_lazy(topic, module_name,
84
84
member_name, info=info)
271
271
would refer to ``/home/remote/myproject/trunk``.
273
Many commands that accept URLs also accept location aliases too. See
274
::doc:`location-alias-help`.
273
Many commands that accept URLs also accept location aliases too.
274
See :doc:`location-alias-help` and :doc:`url-special-chars-help`.
316
316
--builtin Use the built-in version of a command, not the plugin version.
317
317
This does not suppress other plugin effects.
318
318
--no-plugins Do not process any plugins.
319
--no-l10n Do not translate messages.
319
320
--concurrency Number of processes that can be run concurrently (selftest).
321
322
--profile Profile execution using the hotshot profiler.
328
329
will be a pickle.
329
330
--coverage Generate line coverage report in the specified directory.
332
-Oname=value Override the ``name`` config option setting it to ``value`` for
333
the duration of the command. This can be used multiple times if
334
several options need to be overridden.
331
336
See http://doc.bazaar.canonical.com/developers/profiling.html for more
332
337
information on profiling.
513
518
checkout Create a working tree when a branch does not have one.
514
519
remove-tree Removes the working tree from a branch when it is safe to do so.
515
update When a working tree is out of sync with it's associated branch
520
update When a working tree is out of sync with its associated branch
516
521
this will update the tree to match the branch.
591
596
_env_variables = \
592
597
"""Environment Variables
594
=================== =======================================================================
595
BZRPATH Path where bzr is to look for shell plugin external commands.
599
=================== ===========================================================
600
BZRPATH Path where bzr is to look for shell plugin external
596
602
BZR_EMAIL E-Mail address of the user. Overrides EMAIL.
597
603
EMAIL E-Mail address of the user.
598
604
BZR_EDITOR Editor for editing commit messages. Overrides EDITOR.
601
607
BZR_DISABLE_PLUGINS Plugins that bzr should not load.
602
608
BZR_PLUGINS_AT Plugins to load from a directory not in BZR_PLUGIN_PATH.
603
609
BZR_HOME Directory holding .bazaar config dir. Overrides HOME.
604
BZR_HOME (Win32) Directory holding bazaar config dir. Overrides APPDATA and HOME.
610
BZR_HOME (Win32) Directory holding bazaar config dir. Overrides APPDATA and
605
612
BZR_REMOTE_PATH Full name of remote 'bzr' command (for bzr+ssh:// URLs).
606
BZR_SSH Path to SSH client, or one of paramiko, openssh, sshcorp, plink.
613
BZR_SSH Path to SSH client, or one of paramiko, openssh, sshcorp,
607
615
BZR_LOG Location of .bzr.log (use '/dev/null' to suppress log).
608
616
BZR_LOG (Win32) Location of .bzr.log (use 'NUL' to suppress log).
609
617
BZR_COLUMNS Override implicit terminal width.
610
BZR_CONCURRENCY Number of processes that can be run concurrently (selftest).
611
BZR_PROGRESS_BAR Override the progress display. Values are 'none', 'dots', or 'tty'.
618
BZR_CONCURRENCY Number of processes that can be run concurrently (selftest)
619
BZR_PROGRESS_BAR Override the progress display. Values are 'none' or 'text'.
612
620
BZR_PDB Control whether to launch a debugger on error.
613
BZR_SIGQUIT_PDB Control whether SIGQUIT behaves normally or invokes a breakin debugger.
614
=================== =======================================================================
621
BZR_SIGQUIT_PDB Control whether SIGQUIT behaves normally or invokes a
623
BZR_TEXTUI_INPUT Force console input mode for prompts to line-based (instead
625
=================== ===========================================================
756
767
'Information on configuration and log files')
757
768
topic_registry.register_lazy('hooks', 'bzrlib.hooks', 'hooks_help_text',
758
769
'Points at which custom processing can be added')
770
topic_registry.register_lazy('location-alias', 'bzrlib.directory_service',
771
'AliasDirectory.help_text',
772
'Aliases for remembered locations')
760
774
# Load some of the help topics from files. Note that topics which reproduce API
761
775
# details will tend to skew (quickly usually!) so please seek other solutions
768
782
'Types of conflicts and what to do about them')
769
783
topic_registry.register('debug-flags', _load_from_file,
770
784
'Options to show or record debug information')
771
topic_registry.register('location-alias', _load_from_file,
772
'Aliases for remembered locations')
773
785
topic_registry.register('log-formats', _load_from_file,
774
786
'Details on the logging formats available')
787
topic_registry.register('url-special-chars', _load_from_file,
788
'Special character handling in URLs')
777
791
# Register concept topics.
853
def _format_see_also(see_also):
856
result += '\n:See also: '
857
result += ', '.join(sorted(set(see_also)))
839
862
class RegisteredTopic(object):
840
863
"""A help topic which has been registered in the HelpTopicRegistry.
859
882
returned instead of plain text.
861
884
result = topic_registry.get_detail(self.topic)
862
# there is code duplicated here and in bzrlib/plugin.py's
863
# matching Topic code. This should probably be factored in
864
# to a helper function and a common base class.
865
if additional_see_also is not None:
866
see_also = sorted(set(additional_see_also))
870
result += '\n:See also: '
871
result += ', '.join(see_also)
885
result += _format_see_also(additional_see_also)
874
887
result = help_as_plain_text(result)
889
result = i18n.gettext_per_paragraph(result)
877
892
def get_help_topic(self):
892
907
elif line.endswith('::'):
894
909
# Map :doc:`xxx-help` to ``bzr help xxx``
895
line = re.sub(":doc:`(.+)-help`", r'``bzr help \1``', line)
910
line = re.sub(":doc:`(.+?)-help`", r'``bzr help \1``', line)
896
911
result.append(line)
897
912
return "\n".join(result) + "\n"
915
class ConfigOptionHelpIndex(object):
916
"""A help index that returns help topics for config options."""
919
self.prefix = 'configuration/'
921
def get_topics(self, topic):
922
"""Search for topic in the registered config options.
924
:param topic: A topic to search for.
925
:return: A list which is either empty or contains a single
930
elif topic.startswith(self.prefix):
931
topic = topic[len(self.prefix):]
932
if topic in config.option_registry:
933
return [config.option_registry.get(topic)]