Merge lp:~thekorn/ubuntu-qa-tools/fix-344961-in-multiple-sections-329698-avoid-crashes into lp:ubuntu-qa-tools

Proposed by Markus Korn
Status: Merged
Merged at revision: 91
Proposed branch: lp:~thekorn/ubuntu-qa-tools/fix-344961-in-multiple-sections-329698-avoid-crashes
Merge into: lp:ubuntu-qa-tools
Diff against target: None lines
To merge this branch: bzr merge lp:~thekorn/ubuntu-qa-tools/fix-344961-in-multiple-sections-329698-avoid-crashes
Reviewer Review Type Date Requested Status
Ubuntu Bug Control Pending
Review via email: mp+4638@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Markus Korn (thekorn) wrote :

Fixes two bugs in the hugday tool:
  - Don't crash on errors, exit with message and error-code instead
    (LP: #329698)
  - mark all tasks as done if there are multiple tasks with the same bug
    id in different sections (LP: #344961)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2009-03-06 13:41:43 +0000
3+++ debian/changelog 2009-03-18 20:25:21 +0000
4@@ -1,3 +1,13 @@
5+ubuntu-qa-tools (0.1.4) UNRELEASED; urgency=low
6+
7+ * hugday-tools/hugday:
8+ - Don't crash on errors, exit with message and error-code instead
9+ (LP: #329698)
10+ - mark all tasks as done if there are multiple tasks with the same bug
11+ id in different sections (LP: #344961)
12+
13+ -- Markus Korn <thekorn@gmx.de> Wed, 18 Mar 2009 21:22:07 +0100
14+
15 ubuntu-qa-tools (0.1.3) UNRELEASED; urgency=low
16
17 * Changes go here.
18
19=== modified file 'hugday-tools/hugday'
20--- hugday-tools/hugday 2009-02-12 18:56:13 +0000
21+++ hugday-tools/hugday 2009-03-18 20:25:21 +0000
22@@ -331,12 +331,13 @@
23 new_data = ""
24 if user is None:
25 user = config.get("config", "user")
26+ closed_bugs = set()
27 for line in data:
28 if line.startswith("||"):
29 ctx = LINE_RE.search(line)
30 if ctx:
31 nr = ctx.groups()[0]
32- bugs.remove(nr)
33+ closed_bugs.add(nr)
34 cols = line.split("||")
35 triager = cols[3].strip()
36 if "lightgreen" in cols[1] or triager:
37@@ -347,8 +348,9 @@
38 cols[3] = " %s " %user
39 line = "||".join(cols)
40 new_data += line
41+ bugs = set(bugs) - closed_bugs
42 if bugs:
43- raise ValueError("One or more bugs can't be found: %s" %bugs)
44+ raise ValueError("One or more bugs can't be found: %s" %", ".join(map(str, bugs)))
45 data = {
46 "button_save": "1",
47 "savetext": urllib.quote(new_data),
48@@ -408,4 +410,9 @@
49
50
51 if __name__ == "__main__":
52- sys.exit(main())
53+ try:
54+ sys.exit(main())
55+ except Exception, e:
56+ print "%s: %s" %(e.__class__.__name__, e)
57+ sys.exit(1)
58+