Merge lp://staging/~sinzui/bzr-gtk/precise-diff-0 into lp://staging/bzr-gtk

Proposed by Curtis Hovey
Status: Merged
Merged at revision: 772
Proposed branch: lp://staging/~sinzui/bzr-gtk/precise-diff-0
Merge into: lp://staging/bzr-gtk
Diff against target: 187 lines (+65/-23)
4 files modified
diff.py (+13/-4)
tests/__init__.py (+19/-0)
tests/test_commit.py (+1/-19)
tests/test_diff.py (+32/-0)
To merge this branch: bzr merge lp://staging/~sinzui/bzr-gtk/precise-diff-0
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+89759@code.staging.launchpad.net

Commit message

Do not update the DiffWidget when it is being destroyed.

Description of the change

This is a fix for bug 914363, which is private so I cannot see it.
It may not even be reported against bzr-gtk. Everyone can see my
bug 920525 that Apport says is a duplicate.

This is a bzr-gtk gdiff issue. The diff works, but an error happens when
the window is closed. This may be the same kind of issue I fixed in
gcommit where the callback is called while the window is being
destroyed. In that case, The treeview still existed, but it's model and
state were None.

Traceback (most recent call last):
  File "/home/curtis/.bazaar/plugins/gtk/diff.py", line 391, in _treeview_cursor_cb
    specific_files = [ self.model[path][1] ]
  File "/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py", line 730, in __getitem__
    aiter = self.get_iter(key)
  File "/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py", line 744, in get_iter
    path = TreePath(path)
  File "/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py", line 1110, in __new__
    if len(path) == 0:
TypeError: object of type 'NoneType' has no len()

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

RULES

    * Do not attempt to update the diff_view if the path is None.
    * Move the MockMethod helper to a common module so that it can be used
      by any test case
    * Update the DiffWidget to guard the calls to show(), subclasses the
      widget so that tests can run without rendering.

QA

    Using Precise:
    * Branch any project
    * bzr gdiff
    * See no changes
    * close the window
    * Verify there is no traceback in the console.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: