Merge lp://staging/~sinzui/bzr-gtk/precise-commit-1 into lp://staging/bzr-gtk

Proposed by Curtis Hovey
Status: Superseded
Proposed branch: lp://staging/~sinzui/bzr-gtk/precise-commit-1
Merge into: lp://staging/bzr-gtk
Diff against target: 106 lines (+63/-0)
2 files modified
commit.py (+4/-0)
tests/test_commit.py (+59/-0)
To merge this branch: bzr merge lp://staging/~sinzui/bzr-gtk/precise-commit-1
Reviewer Review Type Date Requested Status
Bazaar GTK maintainers Pending
Review via email: mp+89598@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2012-01-22.

Commit message

Do not assume the treeselection exist when the widget is being destroyed.

Description of the change

I consistently see an error when committing using the bzr-gtk lib.

/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
Traceback (most recent call last):
  File "/home/curtis/.bazaar/plugins/gtk/commit.py", line 570, in _on_treeview_files_cursor_changed
    (model, selection) = treeselection.get_selected()
AttributeError: 'NoneType' object has no attribute 'get_selected'

The commit is successful, maybe this error is happening when the window
is being torn down. The error also appears when the dialog is canceled.
There is not error when using the command directly. I think this is an issue
with the calling app calling destroy()

_on_treeview_files_cursor_changed() exist early if there is no selection.
The method could also exit early if there is no treeselection

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

RULES

    * Ensure that there is a treeselection before accessing it.
    * Add tests for the no treeselection and no selection condition
      * test_file_selection implicitly tests the case when there is a
        selection.

QA

Use Gedit with GDP Bzr enabled from the console under precise.
    * Open any file under version control.
    * Choose Project > Commit
    * Cancel the action
    * Verify there is no AttributeError on stdout

To post a comment you must log in.

Unmerged revisions

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: