Merge ~cjwatson/launchpad:fix-stormify-bugbranch into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 8520655b576b0a252ecfa2f401f7ac28e2344e4c
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:fix-stormify-bugbranch
Merge into: launchpad:master
Diff against target: 16 lines (+4/-1)
1 file modified
lib/lp/app/browser/tales.py (+4/-1)
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+380838@code.launchpad.net

Commit message

Temporarily avoid is_empty on bound ReferenceSets

Description of the change

Now that linked_bugbranches is a ReferenceSet, .is_empty() doesn't work on it. I've proposed https://code.launchpad.net/~cjwatson/storm/reference-set-is-empty/+merge/380837 to fix that, but work around it in the meantime.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/app/browser/tales.py b/lib/lp/app/browser/tales.py
2index 22bb6c4..3625593 100644
3--- a/lib/lp/app/browser/tales.py
4+++ b/lib/lp/app/browser/tales.py
5@@ -956,7 +956,10 @@ class BugTaskImageDisplayAPI(ObjectImageDisplayAPI):
6
7 def _hasBugBranch(self):
8 """Return whether the bug has a branch linked to it."""
9- return not self._context.bug.linked_bugbranches.is_empty()
10+ # XXX cjwatson 2020-03-18: This should use the more efficient
11+ # .is_empty(), but that doesn't work on `BoundReferenceSet`s.
12+ # https://code.launchpad.net/~cjwatson/storm/reference-set-is-empty/+merge/380837
13+ return self._context.bug.linked_bugbranches.any() is None
14
15 def _hasSpecification(self):
16 """Return whether the bug is linked to a specification."""

Subscribers

People subscribed via source and target branches

to status/vote changes: