/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: Jelmer Vernooij
  • Date: 2008-04-25 20:23:28 UTC
  • mfrom: (464.2.1 gtk)
  • Revision ID: jelmer@samba.org-20080425202328-3cpit50s53ow5410
Merge patch from Adrian dealing with null revision in a couple of places.

Show diffs side-by-side

added added

removed removed

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