Merge lp:~vila/bzr/996401-doc-config into lp:bzr

Proposed by Vincent Ladeuil on 2012-09-18
Status: Merged
Approved by: John A Meinel on 2012-09-19
Approved revision: 6562
Merged at revision: 6562
Proposed branch: lp:~vila/bzr/996401-doc-config
Merge into: lp:bzr
Diff against target: 94 lines (+44/-7)
3 files modified
bzrlib/config.py (+11/-7)
doc/en/release-notes/bzr-2.6.txt (+3/-0)
doc/en/user-guide/configuring_bazaar.txt (+30/-0)
To merge this branch: bzr merge lp:~vila/bzr/996401-doc-config
Reviewer Review Type Date Requested Status
John A Meinel 2012-09-18 Approve on 2012-09-19
Review via email: mp+124984@code.launchpad.net

Commit message

Clarify option references expansion for `bzr config`.

Description of the change

This addresses bug #996401 by clarifying the command online help especially
around when option references are expanded.

Option references are described in bzrlib/help_topics/en/configuration.txt
which still seems to be the best place for that.

To post a comment you must log in.
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 9/18/2012 8:42 PM, Vincent Ladeuil wrote:
> Vincent Ladeuil has proposed merging lp:~vila/bzr/996401-doc-config
> into lp:bzr.
>
> Requested reviews: bzr-core (bzr-core) Related bugs: Bug #996401 in
> Bazaar: "'bzr config' fails to display config templates referring
> to "unknown" options" https://bugs.launchpad.net/bzr/+bug/996401
>
> For more details, see:
> https://code.launchpad.net/~vila/bzr/996401-doc-config/+merge/124984
>
> This addresses bug #996401 by clarifying the command online help
> especially around when option references are expanded.
>
> Option references are described in
> bzrlib/help_topics/en/configuration.txt which still seems to be the
> best place for that.
>

 merge: approve

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBZTLgACgkQJdeBCYSNAAN6VgCfaopIU9M+UmUrNToA77LE02jS
s38An2lcvtTnYDUApvJrf5qJh1cd/wIz
=1j3N
-----END PGP SIGNATURE-----

review: Approve
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/config.py'
2--- bzrlib/config.py 2012-09-17 08:45:19 +0000
3+++ bzrlib/config.py 2012-09-18 16:46:28 +0000
4@@ -4085,17 +4085,21 @@
5 class cmd_config(commands.Command):
6 __doc__ = """Display, set or remove a configuration option.
7
8- Display the active value for a given option.
9+ Display the active value for option NAME.
10
11 If --all is specified, NAME is interpreted as a regular expression and all
12- matching options are displayed mentioning their scope. The active value
13- that bzr will take into account is the first one displayed for each option.
14-
15- If no NAME is given, --all .* is implied.
16-
17- Setting a value is achieved by using name=value without spaces. The value
18+ matching options are displayed mentioning their scope and without resolving
19+ option references in the value). The active value that bzr will take into
20+ account is the first one displayed for each option.
21+
22+ If NAME is not given, --all .* is implied (all options are displayed for the
23+ current scope).
24+
25+ Setting a value is achieved by using NAME=value without spaces. The value
26 is set in the most relevant scope and can be checked by displaying the
27 option again.
28+
29+ Removing a value is achieved by using --remove NAME.
30 """
31
32 takes_args = ['name?']
33
34=== modified file 'doc/en/release-notes/bzr-2.6.txt'
35--- doc/en/release-notes/bzr-2.6.txt 2012-09-14 17:22:35 +0000
36+++ doc/en/release-notes/bzr-2.6.txt 2012-09-18 16:46:28 +0000
37@@ -63,6 +63,9 @@
38
39 .. Improved or updated documentation.
40
41+* Clarify ``bzr config`` usages especially around other option references
42+ expansion. (Vincent Ladeuil, #996401)
43+
44 API Changes
45 ***********
46
47
48=== modified file 'doc/en/user-guide/configuring_bazaar.txt'
49--- doc/en/user-guide/configuring_bazaar.txt 2011-05-02 08:15:59 +0000
50+++ doc/en/user-guide/configuring_bazaar.txt 2012-09-18 16:46:28 +0000
51@@ -129,6 +129,13 @@
52 Each configuration file is associated with a given scope whose name is
53 displayed before each set of defined options.
54
55+If you need to look at a specific option, you can use::
56+
57+ bzr config <option>
58+
59+This will display only the option value and is intended to be used in
60+scripts.
61+
62 Modifying the active configuration
63 ----------------------------------
64
65@@ -136,6 +143,29 @@
66
67 bzr config opt=value
68
69+An option value can reference another option by enclosing it in curly
70+braces::
71+
72+ bzr config opt={other_opt}/subdir
73+
74+If ``other_opt`` is set to ``'root``, ``bzr config opt`` will display::
75+
76+ root/subdir
77+
78+Note that when ``--all`` is used, the references are left as-is to better
79+reflect the content of the config files and make it easier to organize them::
80+
81+ bzr config --all .*opt
82+
83+ bazaar:
84+ [DEFAULT]
85+ opt = {other_opt}/subdir
86+ other_opt = root
87+
88+
89+
90+
91+
92 To remove an option use::
93
94 bzr config --remove opt