Merge lp:~parthm/bzr/584650-incorrect-alias-info-in-help into lp:bzr

Proposed by Parth Malwankar on 2010-05-26
Status: Merged
Approved by: Parth Malwankar on 2010-05-26
Approved revision: 5257
Merged at revision: 5258
Proposed branch: lp:~parthm/bzr/584650-incorrect-alias-info-in-help
Merge into: lp:bzr
Diff against target: 30 lines (+6/-2)
2 files modified
NEWS (+4/-0)
bzrlib/help.py (+2/-2)
To merge this branch: bzr merge lp:~parthm/bzr/584650-incorrect-alias-info-in-help
Reviewer Review Type Date Requested Status
Martin Pool 2010-05-26 Approve on 2010-05-26
Robert Collins (community) 2010-05-26 Approve on 2010-05-26
Review via email: mp+26018@code.launchpad.net

Commit Message

Fix the display of cmd aliases in the help topic for aliased commands.

Description of the Change

=== Fixes bug #584650 ===

bzrlib.help.help has the signature below (not seen in the diff)

def help(topic=None, outfile=None):

The for loop in the diff was using 'topic' as a variable so in cases where the loop was coming in, topic was being overwritten and as a result the alias info was showing the object name. Renaming the loop variable to topic_obj fixes this.

Unfortunately I don't have a test case for this as the bundled plugins (I tried lp) doesn't have this problem. I have tested this manually.

To post a comment you must log in.
Robert Collins (lifeless) wrote :

looks good; pending a second committer ok.

review: Approve
Martin Pool (mbp) :
review: Approve
Parth Malwankar (parthm) wrote :

Thanks for the review. I will go ahead and land this.

Robert Collins (lifeless) wrote :

sent to pqm by email

Parth Malwankar (parthm) wrote :

> sent to pqm by email

Looks like you got to pqm before me :)
I will skip feed-pqm.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2010-05-25 21:30:52 +0000
3+++ NEWS 2010-05-26 07:49:26 +0000
4@@ -64,6 +64,10 @@
5 Bug Fixes
6 *********
7
8+* Alias information shown by ``bzr help`` is now accurate. This
9+ was showing an internal object name for some plugin aliases.
10+ (Parth Malwankar, #584650)
11+
12 * ``.bazaar``, ``.bazaar/bazaar.conf`` and ``.bzr.log`` inherit user and
13 group ownership from the containing directory. This allow bzr to work
14 better with sudo.
15
16=== modified file 'bzrlib/help.py'
17--- bzrlib/help.py 2010-04-30 11:03:59 +0000
18+++ bzrlib/help.py 2010-05-26 07:49:26 +0000
19@@ -44,9 +44,9 @@
20 try:
21 topics = indices.search(topic)
22 shadowed_terms = []
23- for index, topic in topics[1:]:
24+ for index, topic_obj in topics[1:]:
25 shadowed_terms.append('%s%s' % (index.prefix,
26- topic.get_help_topic()))
27+ topic_obj.get_help_topic()))
28 source = topics[0][1]
29 outfile.write(source.get_help_text(shadowed_terms))
30 except errors.NoHelpTopic: