Merge lp:~robru/cupstream2distro/fix-ido-tags into lp:cupstream2distro

Proposed by Robert Bruce Park on 2015-03-19
Status: Merged
Approved by: Robert Bruce Park on 2015-03-19
Approved revision: 961
Merged at revision: 961
Proposed branch: lp:~robru/cupstream2distro/fix-ido-tags
Merge into: lp:cupstream2distro
Diff against target: 84 lines (+39/-3)
3 files modified
cupstream2distro/branchhandling.py (+2/-2)
tests/strings.py (+29/-1)
tests/unit/test_branchhandling.py (+8/-0)
To merge this branch: bzr merge lp:~robru/cupstream2distro/fix-ido-tags
Reviewer Review Type Date Requested Status
Łukasz Zemczak 2015-03-19 Approve on 2015-03-19
PS Jenkins bot continuous-integration Approve on 2015-03-19
Review via email: mp+253531@code.launchpad.net

Commit Message

Fix unhandled exception in find_newest_branch_tag().

Description of the Change

Fixes:

https://ci-train.ubuntu.com/job/ubuntu-landing-022-1-build/45/console

  File "/var/lib/citrain/cupstream2distro/branchhandling.py", line 150, in find_newest_branch_tag
    tagname, revno = line.split() or ('', '')
ValueError: too many values to unpack

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:961
http://jenkins.qa.ubuntu.com/job/cu2d-choo-choo-ci/623/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/cu2d-choo-choo-ci/623/rebuild

review: Approve (continuous-integration)
Łukasz Zemczak (sil2100) wrote :

Looking good, waiting for CI.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cupstream2distro/branchhandling.py'
2--- cupstream2distro/branchhandling.py 2015-03-16 17:35:09 +0000
3+++ cupstream2distro/branchhandling.py 2015-03-19 15:49:36 +0000
4@@ -147,13 +147,13 @@
5 """
6 stdout = call('bzr tags --sort=time', cwd=self.path)[1]
7 for line in reversed(stdout.split('\n')):
8- tagname, revno = line.split() or ('', '')
9+ tagname, div, revno = line.rpartition(' ')
10 # revno can be like '?', '1.1.7', or '1', so remove periods or
11 # question marks, as those represent non-trunk tags.
12 if revno.isdigit():
13 log_value_of.revno('Diffing since')
14 log_value_of.tagname('Diffing since')
15- return tagname
16+ return tagname.strip()
17
18 def diff_since_newest_branch_tag(self):
19 """Return the relevant part of the bzr log since most recent tag."""
20
21=== modified file 'tests/strings.py'
22--- tests/strings.py 2015-03-16 02:14:52 +0000
23+++ tests/strings.py 2015-03-19 15:49:36 +0000
24@@ -162,12 +162,40 @@
25
26 TAGLIST = """\
27 0.2.0+14.04.20140217.1-0ubuntu1 254
28-0.2.0+14.10.20140714.2-0ubuntu1 257
29+0.2.0+14.10.20140714.2-0ubuntu1 257
30 0.0+r112 7.3.43
31 0.0+r116 7.3.46
32 0.90.0bzr13.04.05-0ubuntu1 ?
33 3.7.0bzr13.04.02-0ubuntu1 ?"""
34
35+TAGLIST_IDO = """\
36+12.10.0 111
37+12.10.1 114
38+12.10.2 116
39+13.10.0+15.04.20150122-0ubuntu1 188
40+13.10.0+15.04.20150130-0ubuntu1 190
41+indicator-sound release 0.3.0 ?
42+0.3.7 ?
43+0.4.8-maverick ?
44+release 2.2 ... ?
45+0.2.8 ?
46+0.1~ppa3 ?
47+indicator-sound-0.1.2 ?
48+indicator-sound-0.1.1 ?
49+0.1-0ubuntu1 ?
50+release-0.3.2 ?
51+0.7.7.0 ?
52+indicator-sound 0.1.3 ?
53+0.1~ppa4~statusshuffle2 ?
54+0.6.4 ?
55+0.1~ppa4~statusshuffle1 ?
56+0.1~ppa2~indicator9ubuntu5 ?
57+0.1~ppa2~indicator9ubuntu8 ?
58+Scrub bar fully functional just before maverick UI freeze ?
59+indicator-sound release 0.2.1 ?
60+0.4.0 release ?
61+"""
62+
63 LOG_DIFF_AXED = """\
64 ------------------------------------------------------------
65 revno: 2289 [merge]
66
67=== modified file 'tests/unit/test_branchhandling.py'
68--- tests/unit/test_branchhandling.py 2015-03-16 02:14:52 +0000
69+++ tests/unit/test_branchhandling.py 2015-03-19 15:49:36 +0000
70@@ -95,6 +95,14 @@
71 '0.2.0+14.10.20140714.2-0ubuntu1')
72
73 @patch('cupstream2distro.branchhandling.call')
74+ def test_find_newest_branch_tag_ido(self, call_mock):
75+ """Extract the newest tag from a list of tags."""
76+ call_mock.return_value = (Mock(returncode=0), s.TAGLIST_IDO, '')
77+ self.assertEqual(
78+ self.branch.find_newest_branch_tag(),
79+ '13.10.0+15.04.20150130-0ubuntu1')
80+
81+ @patch('cupstream2distro.branchhandling.call')
82 def test_find_newest_branch_tag_no_tags(self, call_mock):
83 """Return None if no tags found."""
84 call_mock.return_value = (Mock(returncode=0), '', '')

Subscribers

People subscribed via source and target branches