/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-06-19 16:38:46 UTC
  • mfrom: (59.2.4 bzr-gtk)
  • Revision ID: jelmer@samba.org-20060619163846-16ecedf9ca4b3d1f
[merge] gannotate/gdiff improvements from Aaron.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from bzrlib.delta import compare_trees
25
25
from bzrlib.diff import show_diff_trees
 
26
from bzrlib.errors import NoSuchFile
26
27
 
27
28
 
28
29
class DiffWindow(gtk.Window):
136
137
        self.treeview.expand_all()
137
138
        self.set_title(description + " - bzrk diff")
138
139
 
 
140
    def set_file(self, file_path):
 
141
        tv_path = None
 
142
        for data in self.model:
 
143
            for child in data.iterchildren():
 
144
                if child[0] == file_path:
 
145
                    tv_path = child.path
 
146
                    break
 
147
        if tv_path is None:
 
148
            raise NoSuchFile(file_path)
 
149
        self.treeview.set_cursor(tv_path)
 
150
 
139
151
    def _treeview_cursor_cb(self, *args):
140
152
        """Callback for when the treeview cursor changes."""
141
153
        (path, col) = self.treeview.get_cursor()