Problem in viewing revision difference from `bzr visualise`

Bug #429947 reported by Mantavya Gajjar (Open ERP)
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar GTK+ Frontends
Fix Released
Medium
Vincent Ladeuil

Bug Description

Hello !!!

I am using Ubuntu-8.10 64Bit Version, installed bzr, and bzr-gtk
on my laptop everything configured well, i can pull, push from lanuchpad branches of my related project

I have also check for the bzr whoami it display well date, also i have done the login on the launchpad using
bzr launchpad-login

when i try to run the `bzr visualise` it display the date in good format, but the problem is it will not display the revision difference and generating the error in log file looks like

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/gtk/viz/branchwin.py", line 550, in _diff_visibility_changed
    self.update_diff_panel()
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/gtk/viz/branchwin.py", line 642, in update_diff_panel
    self.diff.set_diff(rev_tree, parent_tree)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/gtk/diff.py", line 331, in set_diff
    self.diff_view = DiffView()
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/gtk/diff.py", line 245, in __init__
    DiffFileView.__init__(self)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/gtk/diff.py", line 67, in __init__
    self.construct()
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/gtk/diff.py", line 81, in construct
    self.apply_gedit_colors(self.buffer)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/gtk/diff.py", line 111, in apply_gedit_colors
    buf.set_style_scheme(style_scheme)
TypeError: GtkSourceBuffer.set_style_scheme() argument 1 must be gtksourceview2.StyleScheme, not None

Related branches

Revision history for this message
Vincent Ladeuil (vila) wrote :

This has been fixed in recent versions of bzr-gtk.

If you don't want to upgrade bzr and bzr-gtk from sources,
you can add https://edge.launchpad.net/~bzr/+archive to your software sources
(follow the link for instructions).

Let us know if that fixes your problem.

affects: bzr → bzr-gtk
Changed in bzr-gtk:
assignee: nobody → Vincent Ladeuil (vila)
status: New → Incomplete
Revision history for this message
Mantavya Gajjar (Open ERP) (mga) wrote : Re: [Bug 429947] Re: Problem in viewing revision difference from `bzr visualise`

Thanks Vincent

for quick reply

On Tue, 2009-09-15 at 11:32 +0000, Vincent Ladeuil wrote:
> This has been fixed in recent versions of bzr-gtk.
>
> If you don't want to upgrade bzr and bzr-gtk from sources,
> you can add https://edge.launchpad.net/~bzr/+archive to your software sources
> (follow the link for instructions).
>
> Let us know if that fixes your problem.
>
> ** Project changed: bzr => bzr-gtk
>
> ** Changed in: bzr-gtk
> Status: New => Incomplete
>
> ** Changed in: bzr-gtk
> Assignee: (unassigned) => Vincent Ladeuil (vila)
>
--
Mantavya Gajjar
Director
Tiny ERP Private Limited, India.
A-705 - Wall Street 2,
Nr, Gujarat College,Ellisbridge,
Ahmedabad - 380006
Gujarat, India
Phone work: +91 79 40050048
Web: http://openerp.com
http://tinyerpindia.com

Revision history for this message
Cyberkilla (cyberkilla04uk-deactivatedaccount) wrote :

Hello, are you sure this is fixed?

I have the latest packages from your PPA and I'm still getting the error:

----------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk/viz/branchwin.py", line 440, in _treeselection_changed_cb
    self.update_diff_panel(revision, parents)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk/viz/branchwin.py", line 642, in update_diff_panel
    self.diff.set_diff(rev_tree, parent_tree)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk/diff.py", line 331, in set_diff
    self.diff_view = DiffView()
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk/diff.py", line 245, in __init__
    DiffFileView.__init__(self)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk/diff.py", line 67, in __init__
    self.construct()
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk/diff.py", line 81, in construct
    self.apply_gedit_colors(self.buffer)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk/diff.py", line 111, in apply_gedit_colors
    buf.set_style_scheme(style_scheme)
TypeError: GtkSourceBuffer.set_style_scheme() argument 1 must be gtksourceview2.StyleScheme, not None
----------

Am I doing something wrong?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Sat, 2009-09-26 at 15:33 +0000, Cyberkilla wrote:
> Hello, are you sure this is fixed?
>
> I have the latest packages from your PPA and I'm still getting the
> error:
I don't think the PPA has a very recent version of bzr-gtk packaged.

Jelmer

Revision history for this message
Cyberkilla (cyberkilla04uk-deactivatedaccount) wrote :

Jelmer, thanks for responding. I've subscribed to the bug.

I am running the latest version of Ubuntu Karmic.

Revision history for this message
Mantavya Gajjar (Open ERP) (mga) wrote :

Hello,

After a long time i check the proposed solution but the same thing. as before. still i face the same problem, i also tried in my VM with Ubuntu-9.04 32-BIT and 64-BIT. and facing same problem

Regards

Revision history for this message
Vincent Ladeuil (vila) wrote :

What does the following commands report:
  bzr version
  bzr plugins -v

Revision history for this message
Vincent Ladeuil (vila) wrote :

@mga: What does the following commands report:
  bzr version
  bzr plugins -v

Revision history for this message
Cyberkilla (cyberkilla04uk-deactivatedaccount) wrote :

Bazaar (bzr) 2.0.0
  Python interpreter: /usr/bin/python 2.6.3
  Python standard library: /usr/lib/python2.6
  Platform: Linux-2.6.31-10-generic-i686-with-Ubuntu-9.10-karmic
  bzrlib: /usr/lib/python2.6/dist-packages/bzrlib
  Bazaar configuration: /home/mcgreevyj/.bazaar
  Bazaar log file: /home/mcgreevyj/.bzr.log

Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://bazaar-vcs.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

------------------------------------

avahi 0.3.0dev
    Advertise and browse branches on the local network via mDNS.
    /usr/lib/python2.6/dist-packages/bzrlib/plugins/avahi

bzrtools 2.0.1
    Various useful commands for working with bzr.
    /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools

dbus 0.1.0dev
    D-Bus integration for bzr/bzrlib.
    /usr/lib/python2.6/dist-packages/bzrlib/plugins/dbus

gtk 0.97.0.final
    Graphical support for Bazaar using GTK.
    /usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk

launchpad 2.0.0
    Launchpad.net integration plugin for Bazaar.
    /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad

netrc_credential_store 2.0.0
    Use ~/.netrc as a credential store for authentication.conf.
    /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store

search 1.7.0dev
    search is a bzr plugin for searching bzr content.
    /usr/lib/python2.6/dist-packages/bzrlib/plugins/search

Revision history for this message
jras (jras) wrote :

I have the same error with bzr-gtk version 0.97.0 from Debian unstable
in line 111 of file /usr/share/pyshared/bzrlib/plugins/gtk/diff.py

The problem is due to the gedit style scheme placed in the directory
~/.gnome2/gedit/styles/ by the gedit preferences gui (Add button).
This directory is not searched by gtksourceview2.StyleSchemeManager().get_scheme().
As the Style Scheme is not found, "None" is assigned to style_scheme and
it is passed to buf.set_style_scheme(style_scheme) giving the error.

So I think there are at least two corrections needed:

1. Add local gedit styles directory in the search path with:
  gtksourceview2.StyleSchemeManager.append_search_path('~/.gnome2/gedit/styles')
  before calling get_scheme().

2. Add a condition to check if style_scheme is not None before line 111
   in file diff.py to avoid other possible unexpected similar errors.

In the mean time there is a workaround for users. Simply move (or copy or link)
the style scheme file (.xml) used from ~/.gnome2/gedit/styles/ into
~/.local/share/gtksourceview-2.0/styles/

Also, I am not sure to fully understand the logic in file diff.py lines 80-82
where probably another condition is needed to check if a scheme style was set
with apply_gedit_colors() before calling apply_colordiff_colors(),
because, as it is now, any change done with apply_gedit_colors() is superseeded
by apply_colordiff_colors() unconditionally.

Revision history for this message
Cyberkilla (cyberkilla04uk-deactivatedaccount) wrote :

Wow, so in other words, it is only a problem if you are using a custom theme for gedit?

I created gtksourceview-2.0/styles and copied over the custom themes just to test - it worked. I then chose one of the default themes and that worked too.

Thanks a lot! I've been waiting for weeks to get a solution to this problem. I'm glad *somebody* can be seen to give a damn.

Changed in bzr-gtk:
status: Incomplete → Fix Released
Changed in bzr-gtk:
status: Fix Released → Confirmed
Revision history for this message
Edward Ari Bichetero (ebichete) wrote :

Changed status to "Confirmed" because bug still exists in trunk and 10.04 "Lucid" (0.98.0.final.1). Have attached a branch with the fix (https://code.launchpad.net/~ebichete/bzr-gtk/bugfix_lp429947). The logic from the fix comes from jras in comment 11 above.

Jelmer Vernooij (jelmer)
Changed in bzr-gtk:
status: Confirmed → Triaged
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in bzr-gtk:
milestone: none → 0.100.0
Jelmer Vernooij (jelmer)
Changed in bzr-gtk:
status: Triaged → 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.