/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 annotate/gannotate.py

  • Committer: Aaron Bentley
  • Date: 2006-06-19 15:44:33 UTC
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: abentley@panoramicfeedback.com-20060619154433-a223b0ee92ed867d
Annotate launches a diff for the particular revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
    def annotate(self, branch, file_id):
60
60
        self.revisions = {}
 
61
        self.annotations = []
 
62
        self.branch = branch
61
63
        
62
64
        # [revision id, line number, committer, revno, highlight color, line]
63
65
        self.annomodel = gtk.ListStore(gobject.TYPE_STRING,
89
91
                                       None,
90
92
                                       line.rstrip("\r\n")
91
93
                                      ])
 
94
                self.annotations.append(revision)
92
95
 
93
96
            if not self.plain:
94
97
                self._set_oldest_newest()
181
184
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
182
185
        sw.set_shadow_type(gtk.SHADOW_IN)
183
186
        sw.add(self.annoview)
 
187
        self.annoview.gwindow = self
184
188
        sw.show()
185
189
        
186
190
        self.pane = pane = gtk.VPaned()
197
201
 
198
202
        self.add(vbox)
199
203
 
 
204
    def row_diff(self, tv, path, tvc):
 
205
        row = path[0]
 
206
        revision = self.annotations[row]
 
207
        tree1 = self.branch.repository.revision_tree(revision.revision_id)
 
208
        tree2 = self.branch.repository.revision_tree(revision.parent_ids[0])
 
209
        from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
 
210
        window = DiffWindow()
 
211
        window.set_diff("Diff for row %d" % row, tree1, tree2)
 
212
        window.show()
 
213
 
 
214
 
200
215
    def _create_annotate_view(self):
201
216
        tv = gtk.TreeView()
202
217
        tv.set_rules_hint(False)
203
218
        tv.connect("cursor-changed", self._show_log)
204
219
        tv.show()
 
220
        tv.connect("row-activated", self.row_diff)
205
221
 
206
222
        cell = gtk.CellRendererText()
207
223
        cell.set_property("xalign", 1.0)