bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'startswith'

9 views
Skip to first unread message

yacinec...@yahoo.com

unread,
Dec 11, 2012, 3:47:15 AM12/11/12
to qb...@googlegroups.com
Greetings,

I have this error when launching bzr qlog and right clicking on the main window's upper pane (the pane containing the graph and the log lines)

bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'startswith'

Here's the file and the line that causes problem.

~/.bazaar/plugins/qbzr/lib/logwidget.py


def show_context_menu(self, pos):
branch_count = len(self.log_model.graph_viz.branches)
(top_revid, old_revid), count = \
self.get_selection_top_and_parent_revids_and_count()


# top_revid is None.

--> wt_selected = top_revid.startswith(CURRENT_REVISION)

def filter_rev_ancestor(action, is_ancestor=True):
branch_menu = action.menu()
if branch_menu:
vis_branch_count = branch_menu.filter_rev_ancestor(
top_revid, is_ancestor)
if vis_branch_count == 0:
action.setVisible(False)

if self.view_commands:
self.context_menu_show_tree.setVisible(count == 1)


If I change the code to something like :

def show_context_menu(self, pos):
branch_count = len(self.log_model.graph_viz.branches)
(top_revid, old_revid), count = \
self.get_selection_top_and_parent_revids_and_count()


wt_selected = None

if top_revid :
wt_selected = top_revid.startswith(CURRENT_REVISION)

def filter_rev_ancestor(action, is_ancestor=True):
branch_menu = action.menu()
if branch_menu:
vis_branch_count = branch_menu.filter_rev_ancestor(
top_revid, is_ancestor)
if vis_branch_count == 0:
action.setVisible(False)

if self.view_commands:
self.context_menu_show_tree.setVisible(count == 1)


I get this error :

bzr: ERROR: exceptions.KeyError: 'key None not in nodes'

Traceback (most recent call last):
File "/home/chaouche/.bazaar/plugins/qbzr/lib/logwidget.py", line 619, in show_context_menu
is_ancestor=False)
File "/home/chaouche/.bazaar/plugins/qbzr/lib/logwidget.py", line 600, in filter_rev_ancestor
top_revid, is_ancestor)
File "/home/chaouche/.bazaar/plugins/qbzr/lib/logwidget.py", line 652, in filter_rev_ancestor
self.graphprovider.known_graph.heads((branch_tip, rev)))
File "_known_graph_pyx.pyx", line 444, in bzrlib._known_graph_pyx.KnownGraph.heads
KeyError: 'key None not in nodes'


That latter file seems to be generated or something, it doesn't even have a path like the others.

Any idea on how to fix this ?
Reply all
Reply to author
Forward
0 new messages