gannotate wrong column type

Bug #707482 reported by Curtis Hovey on 2011-01-25
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar GTK+ Frontends
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) on 2011-01-26
Changed in bzr-gtk:
status: New → Confirmed
importance: Undecided → Medium
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.

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.

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) on 2011-01-27
Changed in bzr-gtk:
status: Confirmed → In Progress
assignee: nobody → Martin Pool (mbp)
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) on 2011-01-28
Changed in bzr-gtk:
status: In Progress → Fix Committed
Jelmer Vernooij (jelmer) on 2011-02-18
Changed in bzr-gtk:
milestone: none → 0.100.0
Jelmer Vernooij (jelmer) on 2011-03-02
Changed in bzr-gtk:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers