/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to viz/branchwin.py

  • Committer: Adrian Wilkins
  • Date: 2008-04-24 15:26:14 UTC
  • mto: This revision was merged to the branch mainline in revision 470.
  • Revision ID: adrian.wilkins@gmail.com-20080424152614-2rnnljbro6vzqvf7
Detect the reserved null: revision in appropriate places. 

This removes a huge shower of stack traces that get dumped to console when 
you look at the bottom of a log.

Show diffs side-by-side

added added

removed removed

Lines of Context:
300
300
        parents  = self.treeview.get_parents()
301
301
        children = self.treeview.get_children()
302
302
 
303
 
        if revision is not None:
 
303
        if revision and revision != NULL_REVISION:
304
304
            prev_menu = gtk.Menu()
305
305
            if len(parents) > 0:
306
306
                self.prev_rev_action.set_sensitive(True)
307
307
                for parent_id in parents:
308
 
                    parent = self.branch.repository.get_revision(parent_id)
309
 
                    try:
310
 
                        str = ' (' + parent.properties['branch-nick'] + ')'
311
 
                    except KeyError:
312
 
                        str = ""
 
308
                    if parent_id and parent_id != NULL_REVISION:
 
309
                        parent = self.branch.repository.get_revision(parent_id)
 
310
                        try:
 
311
                            str = ' (' + parent.properties['branch-nick'] + ')'
 
312
                        except KeyError:
 
313
                            str = ""
313
314
 
314
 
                    item = gtk.MenuItem(parent.message.split("\n")[0] + str)
315
 
                    item.connect('activate', self._set_revision_cb, parent_id)
316
 
                    prev_menu.add(item)
 
315
                        item = gtk.MenuItem(parent.message.split("\n")[0] + str)
 
316
                        item.connect('activate', self._set_revision_cb, parent_id)
 
317
                        prev_menu.add(item)
317
318
                prev_menu.show_all()
318
319
            else:
319
320
                self.prev_rev_action.set_sensitive(False)