~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help_topics/__init__.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
rendering on the screen naturally.
34
34
"""
35
35
 
36
 
import sys
 
36
from __future__ import absolute_import
37
37
 
38
38
import bzrlib
39
39
from bzrlib import (
331
331
               will be a pickle.
332
332
--coverage     Generate line coverage report in the specified directory.
333
333
 
 
334
-Oname=value   Override the ``name`` config option setting it to ``value`` for
 
335
               the duration of the command.  This can be used multiple times if
 
336
               several options need to be overridden.
 
337
 
334
338
See http://doc.bazaar.canonical.com/developers/profiling.html for more
335
339
information on profiling.
336
340
 
591
595
"""
592
596
 
593
597
 
594
 
_env_variables = \
595
 
"""Environment Variables
596
 
 
597
 
=================== ===========================================================
598
 
BZRPATH             Path where bzr is to look for shell plugin external
599
 
                    commands.
600
 
BZR_EMAIL           E-Mail address of the user. Overrides EMAIL.
601
 
EMAIL               E-Mail address of the user.
602
 
BZR_EDITOR          Editor for editing commit messages. Overrides EDITOR.
603
 
EDITOR              Editor for editing commit messages.
604
 
BZR_PLUGIN_PATH     Paths where bzr should look for plugins.
605
 
BZR_DISABLE_PLUGINS Plugins that bzr should not load.
606
 
BZR_PLUGINS_AT      Plugins to load from a directory not in BZR_PLUGIN_PATH.
607
 
BZR_HOME            Directory holding .bazaar config dir. Overrides HOME.
608
 
BZR_HOME (Win32)    Directory holding bazaar config dir. Overrides APPDATA and
609
 
                    HOME.
610
 
BZR_REMOTE_PATH     Full name of remote 'bzr' command (for bzr+ssh:// URLs).
611
 
BZR_SSH             Path to SSH client, or one of paramiko, openssh, sshcorp,
612
 
                    plink or lsh.
613
 
BZR_LOG             Location of .bzr.log (use '/dev/null' to suppress log).
614
 
BZR_LOG (Win32)     Location of .bzr.log (use 'NUL' to suppress log).
615
 
BZR_COLUMNS         Override implicit terminal width.
616
 
BZR_CONCURRENCY     Number of processes that can be run concurrently (selftest)
617
 
BZR_PROGRESS_BAR    Override the progress display. Values are 'none' or 'text'.
618
 
BZR_PDB             Control whether to launch a debugger on error.
619
 
BZR_SIGQUIT_PDB     Control whether SIGQUIT behaves normally or invokes a
620
 
                    breakin debugger.
621
 
=================== ===========================================================
622
 
"""
623
 
 
 
598
known_env_variables = [
 
599
    ("BZRPATH", "Path where bzr is to look for shell plugin external commands."),
 
600
    ("BZR_EMAIL", "E-Mail address of the user. Overrides EMAIL."),
 
601
    ("EMAIL", "E-Mail address of the user."),
 
602
    ("BZR_EDITOR", "Editor for editing commit messages. Overrides EDITOR."),
 
603
    ("EDITOR", "Editor for editing commit messages."),
 
604
    ("BZR_PLUGIN_PATH", "Paths where bzr should look for plugins."),
 
605
    ("BZR_DISABLE_PLUGINS", "Plugins that bzr should not load."),
 
606
    ("BZR_PLUGINS_AT", "Plugins to load from a directory not in BZR_PLUGIN_PATH."),
 
607
    ("BZR_HOME", "Directory holding .bazaar config dir. Overrides HOME."),
 
608
    ("BZR_HOME (Win32)", "Directory holding bazaar config dir. Overrides APPDATA and HOME."),
 
609
    ("BZR_REMOTE_PATH", "Full name of remote 'bzr' command (for bzr+ssh:// URLs)."),
 
610
    ("BZR_SSH", "Path to SSH client, or one of paramiko, openssh, sshcorp, plink or lsh."),
 
611
    ("BZR_LOG", "Location of .bzr.log (use '/dev/null' to suppress log)."),
 
612
    ("BZR_LOG (Win32)", "Location of .bzr.log (use 'NUL' to suppress log)."),
 
613
    ("BZR_COLUMNS", "Override implicit terminal width."),
 
614
    ("BZR_CONCURRENCY", "Number of processes that can be run concurrently (selftest)"),
 
615
    ("BZR_PROGRESS_BAR", "Override the progress display. Values are 'none' or 'text'."),
 
616
    ("BZR_PDB", "Control whether to launch a debugger on error."),
 
617
    ("BZR_SIGQUIT_PDB", "Control whether SIGQUIT behaves normally or invokes a breakin debugger."),
 
618
    ("BZR_TEXTUI_INPUT", "Force console input mode for prompts to line-based (instead of char-based)."),
 
619
    ]
 
620
 
 
621
def _env_variables(topic):
 
622
    import textwrap
 
623
    ret = ["Environment Variables\n\n"
 
624
        "See bzr help configuration for more details.\n\n"]
 
625
    max_key_len = max([len(k[0]) for k in known_env_variables])
 
626
    desc_len = (80 - max_key_len - 2)
 
627
    ret.append("=" * max_key_len + " " + "=" * desc_len + "\n")
 
628
    for k, desc in known_env_variables:
 
629
        ret.append(k + (max_key_len + 1 - len(k)) * " ")
 
630
        ret.append("\n".join(textwrap.wrap(
 
631
            desc, width=desc_len, subsequent_indent=" " * (max_key_len + 1))))
 
632
        ret.append("\n")
 
633
    ret += "=" * max_key_len + " " + "=" * desc_len + "\n"
 
634
    return "".join(ret)
624
635
 
625
636
_files = \
626
637
r"""Files
733
744
topic_registry.register('basic', _basic_help, "Basic commands", SECT_HIDDEN)
734
745
topic_registry.register('topics', _help_on_topics, "Topics list", SECT_HIDDEN)
735
746
def get_current_formats_topic(topic):
736
 
    from bzrlib import bzrdir
 
747
    from bzrlib import controldir
737
748
    return "Current Storage Formats\n\n" + \
738
 
        bzrdir.format_registry.help_topic(topic)
 
749
        controldir.format_registry.help_topic(topic)
739
750
def get_other_formats_topic(topic):
740
 
    from bzrlib import bzrdir
 
751
    from bzrlib import controldir
741
752
    return "Other Storage Formats\n\n" + \
742
 
        bzrdir.format_registry.help_topic(topic)
 
753
        controldir.format_registry.help_topic(topic)
743
754
topic_registry.register('current-formats', get_current_formats_topic,
744
755
    'Current storage formats')
745
756
topic_registry.register('other-formats', get_other_formats_topic,
763
774
                        'Information on configuration and log files')
764
775
topic_registry.register_lazy('hooks', 'bzrlib.hooks', 'hooks_help_text',
765
776
                        'Points at which custom processing can be added')
 
777
topic_registry.register_lazy('location-alias', 'bzrlib.directory_service',
 
778
                        'AliasDirectory.help_text',
 
779
                        'Aliases for remembered locations')
766
780
 
767
781
# Load some of the help topics from files. Note that topics which reproduce API
768
782
# details will tend to skew (quickly usually!) so please seek other solutions
775
789
                        'Types of conflicts and what to do about them')
776
790
topic_registry.register('debug-flags', _load_from_file,
777
791
                        'Options to show or record debug information')
778
 
topic_registry.register('location-alias', _load_from_file,
779
 
                        'Aliases for remembered locations')
780
792
topic_registry.register('log-formats', _load_from_file,
781
793
                        'Details on the logging formats available')
782
794
topic_registry.register('url-special-chars', _load_from_file,