/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/treeview.py

  • Committer: Daniel Schierbeck
  • Date: 2007-11-03 02:19:54 UTC
  • mto: (330.6.6 trunk)
  • mto: This revision was merged to the branch mainline in revision 342.
  • Revision ID: daniel.schierbeck@gmail.com-20071103021954-5yaxi9obl69zppje
Made it possible to view the diff of an orphant revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
 
147
147
        return False
148
148
 
149
 
    def show_diff(self, branch, revid, parentid):
 
149
    def show_diff(self, branch, revid, parentid=None):
150
150
        """Open a new window to show a diff between the given revisions."""
151
151
        from bzrlib.plugins.gtk.diff import DiffWindow
152
152
        window = DiffWindow(parent=self)
153
 
        (parent_tree, rev_tree) = branch.repository.revision_trees([parentid, 
154
 
                                                                   revid])
 
153
 
 
154
        rev_tree    = branch.repository.revision_tree(revid)
 
155
        parent_tree = branch.repository.revision_tree(parentid)
 
156
 
155
157
        description = revid + " - " + branch.nick
156
158
        window.set_diff(description, rev_tree, parent_tree)
157
159
        window.show()
243
245
        """Callback for when a treeview row gets activated."""
244
246
        revision_id = self.model[path][treemodel.REVID]
245
247
        parents = self.model[path][treemodel.PARENTS]
 
248
 
246
249
        if len(parents) == 0:
247
 
            # Ignore revisions without parent
248
 
            return
249
 
        parent_id = parents[0]
 
250
            parent_id = None
 
251
        else:
 
252
            parent_id = parents[0]
 
253
 
250
254
        self.show_diff(self.branch, revision_id, parent_id)
251
255
        self.treeview.grab_focus()