Merge lp:~jameinel/bzr/2.4-launchpad-package-freshness-609187 into lp:bzr/2.4

Proposed by John A Meinel
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: 6026
Proposed branch: lp:~jameinel/bzr/2.4-launchpad-package-freshness-609187
Merge into: lp:bzr/2.4
Diff against target: 30 lines (+6/-1)
2 files modified
bzrlib/plugins/launchpad/__init__.py (+3/-1)
bzrlib/plugins/launchpad/test_lp_api_lite.py (+3/-0)
To merge this branch: bzr merge lp:~jameinel/bzr/2.4-launchpad-package-freshness-609187
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+70596@code.launchpad.net

Commit message

Bug #816417, handle if Branch.base is None

Description of the change

This is an update, addressing bug #816417. It seems bzr-svn/hg/git weren't setting Branch.base until after __init__.

While it is good that those got fixed (so that Branch.open hook actually has a base for all branches), it still is reasonable to workaround it in the Launchpad plugin.

I'm proposing it for the 2.4 series, since it will get auto-landed into bzr.dev.

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

Nice and clean !

But why didn't you add a specific test instead of adding to an existing test ?

review: Approve
Revision history for this message
John A Meinel (jameinel) wrote :

sent to pqm by email

Revision history for this message
John A Meinel (jameinel) wrote :

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

On 8/5/2011 7:09 PM, Vincent Ladeuil wrote:
> Review: Approve Nice and clean !
>
> But why didn't you add a specific test instead of adding to an
> existing test ?
>

Because we already have 1 test for "things that match" vs 1 test for
"things that do match". I just added an entry for "things that don't
match".

Arguably this could be a different test, because it is a different
unmatching type (None vs str).

It didn't seem worth it to me.

John
=:->

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

iEYEARECAAYFAk48ORMACgkQJdeBCYSNAAPfFgCfdIcDvrQPjJHNkl4PcQHsFtfr
5UEAn1PJzFG03ENU8ThTutIx3MQ55fD+
=97Z8
-----END PGP SIGNATURE-----

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/plugins/launchpad/__init__.py'
2--- bzrlib/plugins/launchpad/__init__.py 2011-07-26 08:18:56 +0000
3+++ bzrlib/plugins/launchpad/__init__.py 2011-08-05 16:47:26 +0000
4@@ -479,9 +479,11 @@
5 :return: If this isn't a packaging branch, return None. If it is, return
6 (archive, series, project)
7 """
8+ if url is None:
9+ return None
10 m = _package_branch.search(url)
11 if m is None:
12- return
13+ return None
14 archive, series, project, user = m.group('archive', 'series',
15 'project', 'user')
16 if series is not None:
17
18=== modified file 'bzrlib/plugins/launchpad/test_lp_api_lite.py'
19--- bzrlib/plugins/launchpad/test_lp_api_lite.py 2011-07-26 08:18:56 +0000
20+++ bzrlib/plugins/launchpad/test_lp_api_lite.py 2011-08-05 16:47:26 +0000
21@@ -328,6 +328,9 @@
22 self.assertNotPackageBranch(
23 'http://bazaar.launchpad.net/+branch'
24 '/~user/ubuntu/natty/foo/natty')
25+ # Older versions of bzr-svn/hg/git did not set Branch.base until after
26+ # they called Branch.__init__().
27+ self.assertNotPackageBranch(None)
28
29 def test__get_package_branch_info(self):
30 self.assertBranchInfo(

Subscribers

People subscribed via source and target branches