Rev 6509: (jelmer) Generate environment variables section in bzr(1) from standard list in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Mar 16 13:46:57 UTC 2012
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6509 [merge]
revision-id: pqm at pqm.ubuntu.com-20120316134656-09uo23ku9v8koj7p
parent: pqm at pqm.ubuntu.com-20120315213553-pj1g3cjj19nstvns
parent: jelmer at samba.org-20120315153612-0f69zshzykcb1amf
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2012-03-16 13:46:56 +0000
message:
(jelmer) Generate environment variables section in bzr(1) from standard list
of environment variables. (Jelmer Vernooij)
modified:
bzrlib/doc_generate/autodoc_man.py bzrman.py-20050601153041-0ff7f74de456d15e
bzrlib/help_topics/__init__.py help_topics.py-20060920210027-rnim90q9e0bwxvy4-1
doc/en/release-notes/bzr-2.6.txt bzr2.6.txt-20120116134316-8w1xxom1c7vcu1t5-1
=== modified file 'bzrlib/doc_generate/autodoc_man.py'
--- a/bzrlib/doc_generate/autodoc_man.py 2012-03-14 18:11:34 +0000
+++ b/bzrlib/doc_generate/autodoc_man.py 2012-03-16 13:46:56 +0000
@@ -56,6 +56,7 @@
outfile.write(man_escape(man_head % params))
outfile.write(man_escape(getcommand_list(params)))
outfile.write(man_escape(getcommand_help(params)))
+ outfile.write("".join(environment_variables()))
outfile.write(man_escape(man_foot % params))
@@ -171,6 +172,16 @@
return help
+def environment_variables():
+ yield ".SH \"ENVIRONMENT\"\n"
+
+ from bzrlib.help_topics import known_env_variables
+ for k, desc in known_env_variables:
+ yield ".TP\n"
+ yield ".I \"%s\"\n" % k
+ yield man_escape(desc) + "\n"
+
+
man_preamble = """\
.\\\"Man page for Bazaar (%(bzrcmd)s)
.\\\"
@@ -215,30 +226,6 @@
"""
man_foot = """\
-.SH "ENVIRONMENT"
-.TP
-.I "BZRPATH"
-Path where
-.B "%(bzrcmd)s"
-is to look for shell plugin external commands.
-.TP
-.I "BZR_EMAIL"
-E-Mail address of the user. Overrides default user config.
-.TP
-.I "EMAIL"
-E-Mail address of the user. Overrides default user config.
-.TP
-.I "BZR_EDITOR"
-Editor for editing commit messages
-.TP
-.I "EDITOR"
-Editor for editing commit messages
-.TP
-.I "BZR_PLUGIN_PATH"
-Paths where bzr should look for plugins
-.TP
-.I "BZR_HOME"
-Home directory for bzr
.SH "FILES"
.TP
.I "~/.bazaar/bazaar.conf"
=== modified file 'bzrlib/help_topics/__init__.py'
--- a/bzrlib/help_topics/__init__.py 2012-02-23 19:45:15 +0000
+++ b/bzrlib/help_topics/__init__.py 2012-03-15 15:36:12 +0000
@@ -595,38 +595,42 @@
"""
-_env_variables = \
-"""Environment Variables
-
-=================== ===========================================================
-BZRPATH Path where bzr is to look for shell plugin external
- commands.
-BZR_EMAIL E-Mail address of the user. Overrides EMAIL.
-EMAIL E-Mail address of the user.
-BZR_EDITOR Editor for editing commit messages. Overrides EDITOR.
-EDITOR Editor for editing commit messages.
-BZR_PLUGIN_PATH Paths where bzr should look for plugins.
-BZR_DISABLE_PLUGINS Plugins that bzr should not load.
-BZR_PLUGINS_AT Plugins to load from a directory not in BZR_PLUGIN_PATH.
-BZR_HOME Directory holding .bazaar config dir. Overrides HOME.
-BZR_HOME (Win32) Directory holding bazaar config dir. Overrides APPDATA and
- HOME.
-BZR_REMOTE_PATH Full name of remote 'bzr' command (for bzr+ssh:// URLs).
-BZR_SSH Path to SSH client, or one of paramiko, openssh, sshcorp,
- plink or lsh.
-BZR_LOG Location of .bzr.log (use '/dev/null' to suppress log).
-BZR_LOG (Win32) Location of .bzr.log (use 'NUL' to suppress log).
-BZR_COLUMNS Override implicit terminal width.
-BZR_CONCURRENCY Number of processes that can be run concurrently (selftest)
-BZR_PROGRESS_BAR Override the progress display. Values are 'none' or 'text'.
-BZR_PDB Control whether to launch a debugger on error.
-BZR_SIGQUIT_PDB Control whether SIGQUIT behaves normally or invokes a
- breakin debugger.
-BZR_TEXTUI_INPUT Force console input mode for prompts to line-based (instead
- of char-based).
-=================== ===========================================================
-"""
-
+known_env_variables = [
+ ("BZRPATH", "Path where bzr is to look for shell plugin external commands."),
+ ("BZR_EMAIL", "E-Mail address of the user. Overrides EMAIL."),
+ ("EMAIL", "E-Mail address of the user."),
+ ("BZR_EDITOR", "Editor for editing commit messages. Overrides EDITOR."),
+ ("EDITOR", "Editor for editing commit messages."),
+ ("BZR_PLUGIN_PATH", "Paths where bzr should look for plugins."),
+ ("BZR_DISABLE_PLUGINS", "Plugins that bzr should not load."),
+ ("BZR_PLUGINS_AT", "Plugins to load from a directory not in BZR_PLUGIN_PATH."),
+ ("BZR_HOME", "Directory holding .bazaar config dir. Overrides HOME."),
+ ("BZR_HOME (Win32)", "Directory holding bazaar config dir. Overrides APPDATA and HOME."),
+ ("BZR_REMOTE_PATH", "Full name of remote 'bzr' command (for bzr+ssh:// URLs)."),
+ ("BZR_SSH", "Path to SSH client, or one of paramiko, openssh, sshcorp, plink or lsh."),
+ ("BZR_LOG", "Location of .bzr.log (use '/dev/null' to suppress log)."),
+ ("BZR_LOG (Win32)", "Location of .bzr.log (use 'NUL' to suppress log)."),
+ ("BZR_COLUMNS", "Override implicit terminal width."),
+ ("BZR_CONCURRENCY", "Number of processes that can be run concurrently (selftest)"),
+ ("BZR_PROGRESS_BAR", "Override the progress display. Values are 'none' or 'text'."),
+ ("BZR_PDB", "Control whether to launch a debugger on error."),
+ ("BZR_SIGQUIT_PDB", "Control whether SIGQUIT behaves normally or invokes a breakin debugger."),
+ ("BZR_TEXTUI_INPUT", "Force console input mode for prompts to line-based (instead of char-based)."),
+ ]
+
+def _env_variables(topic):
+ import textwrap
+ ret = ["Environment Variables\n\n"]
+ max_key_len = max([len(k[0]) for k in known_env_variables])
+ desc_len = (80 - max_key_len - 2)
+ ret.append("=" * max_key_len + " " + "=" * desc_len + "\n")
+ for k, desc in known_env_variables:
+ ret.append(k + (max_key_len + 1 - len(k)) * " ")
+ ret.append("\n".join(textwrap.wrap(
+ desc, width=desc_len, subsequent_indent=" " * (max_key_len + 1))))
+ ret.append("\n")
+ ret += "=" * max_key_len + " " + "=" * desc_len + "\n"
+ return "".join(ret)
_files = \
r"""Files
=== modified file 'doc/en/release-notes/bzr-2.6.txt'
--- a/doc/en/release-notes/bzr-2.6.txt 2012-03-15 15:09:48 +0000
+++ b/doc/en/release-notes/bzr-2.6.txt 2012-03-16 13:46:56 +0000
@@ -123,6 +123,9 @@
the other Launchpad plugin commands in bzr(1).
(Jelmer Vernooij, #843801, #163995)
+* Generate ``ENVIRONMENT`` section in bzr(1) from known environment variable
+ list rather than hardcoding. (Jelmer Vernooij, #197618)
+
* Prevent lines of command descriptions starting with a dot to
accidentally be interpreted as a roff macro in bzr(1).
(Jelmer Vernooij, #711079)
More information about the bazaar-commits
mailing list