gannotate wrong column type

Bug #707482 reported by Curtis Hovey
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar GTK+ Frontends
Fix Released
Medium
Martin Pool

Bug Description

gannotate fails to display the files and annotations in natty (gtk 2.22)

Traceback (most recent call last):
  File "/home/curtis/.gnome2/gedit/plugins/gdp/bzr.py", line 261, in show_annotations
    window.annotate(self.working_tree, branch, file_id)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/gtk/annotate/gannotate.py", line 104, in annotate
    line.rstrip("\r\n")
TypeError: value is of wrong type for this column

I have fixed similar gtk issues recently. The tree model requires an explicit cast. I see the ListStore is only composed of gobject.TYPE_STRING. The type could be changed to gobject.TYPE_INT or line_no and revno can be cast using str().

Related branches

Martin Pool (mbp)
Changed in bzr-gtk:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
John A Meinel (jameinel) wrote :

I think revno is going to often be a dotted revno, so not suitable to be a simple integer. So you'd have to go TYPE_STRING there. I don't see why the line_no couldn't always be a TYPE_INT.

Revision history for this message
Martin Pool (mbp) wrote :

so at the moment there are 6 columns, all type string. revno is definitely dotted and may be a string. i guess the lineno column should change to be an int.

Revision history for this message
Curtis Hovey (sinzui) wrote :

I think the underlying issue here is that the column should be int, but there is no int cell render class. Most code uses GtkCellRendererText as gannottate does for int columns. The class /did/ manage the cast for you, but it guesses at how to do it, and not everyone thinks it guess well. So we are being asked to be explicit in the lastest versions of gtk.

Martin Pool (mbp)
Changed in bzr-gtk:
status: Confirmed → In Progress
assignee: nobody → Martin Pool (mbp)
Revision history for this message
Martin Pool (mbp) wrote :

https://code.launchpad.net/~mbp/bzr-gtk/707482-typeerror/+merge/47628

This works for me on maverick (so does not regress) and I think it is type safe. If someone on natty would be kind enough to try it that would be great.

Martin Pool (mbp)
Changed in bzr-gtk:
status: In Progress → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-gtk:
milestone: none → 0.100.0
Jelmer Vernooij (jelmer)
Changed in bzr-gtk:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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