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

  • Committer: Jelmer Vernooij
  • Date: 2006-05-19 16:56:46 UTC
  • mfrom: (0.1.25 gannotate)
  • Revision ID: jelmer@samba.org-20060519165646-0d867938fdbc9097
Merge in Dan Loda's gannotate plugin and put it in annotate/

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    differences between two revisions on a branch.
33
33
    """
34
34
 
35
 
    def __init__(self):
 
35
    def __init__(self, app=None):
36
36
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
37
37
        self.set_border_width(0)
38
38
        self.set_title("bzrk diff")
39
39
 
 
40
        self.app = app
 
41
 
40
42
        # Use two thirds of the screen by default
41
43
        screen = self.get_screen()
42
44
        monitor = screen.get_monitor_geometry(0)
98
100
        scrollwin.add(sourceview)
99
101
        sourceview.show()
100
102
 
101
 
    def set_diff(self, description, rev_tree, parent_tree):
 
103
    def set_diff(self, branch, revid, parentid):
102
104
        """Set the differences showed by this window.
103
105
 
104
106
        Compares the two trees and populates the window with the
105
107
        differences.
106
108
        """
107
 
        self.rev_tree = rev_tree
108
 
        self.parent_tree = parent_tree
 
109
        self.rev_tree = branch.repository.revision_tree(revid)
 
110
        self.parent_tree = branch.repository.revision_tree(parentid)
109
111
 
110
112
        self.model.clear()
111
113
        delta = compare_trees(self.parent_tree, self.rev_tree)
134
136
                self.model.append(titer, [ path, path ])
135
137
 
136
138
        self.treeview.expand_all()
137
 
        self.set_title(description + " - bzrk diff")
 
139
        self.set_title(revid + " - " + branch.nick + " - bzrk diff")
138
140
 
139
141
    def _treeview_cursor_cb(self, *args):
140
142
        """Callback for when the treeview cursor changes."""