Merge lp:~blueyed/apport/bug532944-lucid into lp:~ubuntu-core-dev/ubuntu/lucid/apport/ubuntu

Proposed by Daniel Hahler
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~blueyed/apport/bug532944-lucid
Merge into: lp:~ubuntu-core-dev/ubuntu/lucid/apport/ubuntu
Diff against target: 50 lines (+24/-1)
2 files modified
apport/ui.py (+16/-1)
debian/changelog (+8/-0)
To merge this branch: bzr merge lp:~blueyed/apport/bug532944-lucid
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+20793@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Nice catch, thanks! Applied to trunk (r1717), thus I didn't merge your branch directly (it doesn't apply to trunk).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apport/ui.py'
2--- apport/ui.py 2010-02-22 20:54:14 +0000
3+++ apport/ui.py 2010-03-05 23:32:21 +0000
4@@ -604,7 +604,9 @@
5
6 # no argument: default to "show pending crashes" except when called in
7 # bug mode
8- if len(self.args) == 0 and cmd.endswith('-bug'):
9+ # NOTE: uses sys.argv, since self.args if empty for all the options,
10+ # e.g. "-v" or "-u $BUG"
11+ if len(sys.argv) == 1 and cmd.endswith('-bug'):
12 self.options.filebug = True
13 return
14
15@@ -1624,6 +1626,19 @@
16 self.assertEqual(self.ui.run_argv(), False)
17 self.assertEqual(self.ui.msg_severity, 'error')
18
19+ def test_run_version(self):
20+ '''run_report_bug() as "ubuntu-bug" with version argument.
21+ (LP: #532944)'''
22+
23+ sys.argv = ['ubuntu-bug', '-v']
24+ self.ui = _TestSuiteUserInterface()
25+ orig_stdout = sys.stdout
26+ sys.stdout = StringIO()
27+ self.assertEqual(self.ui.run_argv(), True)
28+ output = sys.stdout.getvalue()
29+ sys.stdout = orig_stdout
30+ self.assertEqual(output, __version__+"\n")
31+
32 def test_run_report_bug_package(self):
33 '''run_report_bug() for a package.'''
34
35
36=== modified file 'debian/changelog'
37--- debian/changelog 2010-03-05 21:52:39 +0000
38+++ debian/changelog 2010-03-05 23:32:21 +0000
39@@ -1,3 +1,11 @@
40+apport (1.12.1-0ubuntu6) UNRELEASED; urgency=low
41+
42+ * apport/ui.py: use sys.argv instead of parsed self.args when
43+ defaulting to self.options.filebug.
44+ This makes "ubuntu-bug -v" and others work as expected. (LP: #532944)
45+
46+ -- Daniel Hahler <ubuntu@thequod.de> Sat, 06 Mar 2010 00:21:37 +0100
47+
48 apport (1.12.1-0ubuntu5) lucid; urgency=low
49
50 * launchpad.py: Do not escalate a bug if its already been escalated and

Subscribers

People subscribed via source and target branches

to all changes: