clicking on a parent/children revision in qlog fails

Bug #247820 reported by Lukáš Lalinský
2
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
Medium
Gary van der Merwe

Bug Description

If I click on any link in "Parents:" or "Children:", it fails with:

Traceback (most recent call last):
  File "/home/lukas/.bazaar/plugins/qbzr/lib/log.py", line 385, in link_clicked
    self.changesModel.ensure_rev_visible(revision_id)
  File "/home/lukas/.bazaar/plugins/qbzr/lib/logmodel.py", line 650, in ensure_rev_visible
    branch_id = self.branch_lines[branch_id][3][0]
TypeError: 'set' object is unindexable

Tags: qlog
Revision history for this message
Lukáš Lalinský (luks) wrote :

=== modified file 'lib/logmodel.py'
--- lib/logmodel.py 2008-06-11 11:51:51 +0000
+++ lib/logmodel.py 2008-07-12 09:15:51 +0000
@@ -646,9 +646,10 @@
         rev_msri = self.revid_msri[revid]
         branch_id = self.merge_sorted_revisions[rev_msri][3][0:-1]
         has_change = self._set_branch_visible(branch_id, True, False)
- while not self._has_visible_child(branch_id):
- branch_id = self.branch_lines[branch_id][3][0]
- has_change = self._set_branch_visible(branch_id, True, False)
+ if branch_id:
+ while not self._has_visible_child(branch_id):
+ branch_id = self.branch_lines[branch_id][3][0]
+ has_change = self._set_branch_visible(branch_id, True, False)
         if has_change:
             self.compute_lines()

This seems to fix it, but I'm not sure if it's right. I assume branch_id () is the mainline and so the loop doesn't make sense for it.

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

This code is to handle the following situation: if you have the following rev graph:

3
|\
| 2.1.1
|/ \
2 |
| 1.1.1
|_/
1

If you select 1 and click on the link to 1.1.1, then it must also make 2.1.1 visible.

My code was not 100%, in that the loop should be stopping when it gets to the mainline. I have fixed this and reported bug.

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

Aggh - editor was not using monspace. Here is a better revision graph for the comment above:

3
|\
| 2.1.1
|/ \
2 |
| 1.1.1
|_/
1

Changed in qbzr:
assignee: nobody → garyvdm
importance: Undecided → Medium
milestone: none → 0.9.2
Changed in qbzr:
status: New → Fix Committed
Changed in qbzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.