/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 olive/diff.py

  • Committer: Jelmer Vernooij
  • Date: 2006-09-27 17:49:18 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927174918-0e5c331b574d16a3
Don't pass along dialog context everywhere.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
import bzrlib
45
45
 
46
 
if bzrlib.version_info < (0, 9):
47
 
    # function deprecated after 0.9
48
 
    from bzrlib.delta import compare_trees
49
 
 
50
46
from bzrlib.diff import show_diff_trees
51
47
import bzrlib.errors as errors
52
48
from bzrlib.workingtree import WorkingTree
53
49
 
54
50
class OliveDiff:
55
51
    """ Display Diff window and perform the needed actions. """
56
 
    def __init__(self, gladefile, comm, dialog):
 
52
    def __init__(self, gladefile, comm):
57
53
        """ Initialize the Diff window. """
58
54
        self.gladefile = gladefile
59
55
        self.glade = gtk.glade.XML(self.gladefile, 'window_diff', 'olive-gtk')
60
56
        
61
57
        # Communication object
62
58
        self.comm = comm
63
 
        # Dialog object
64
 
        self.dialog = dialog
65
59
        
66
60
        # Get some important widgets
67
61
        self.window = self.glade.get_widget('window_diff')
103
97
    def display(self):
104
98
        """ Display the Diff window. """
105
99
        if self.notbranch:
106
 
            self.dialog.error_dialog(_('Directory is not a branch'),
 
100
            error_dialog(_('Directory is not a branch'),
107
101
                                     _('You can perform this action only in a branch.'))
108
102
            self.close()
109
103
        else:
141
135
    def _init_diff(self):
142
136
        """ Generate initial diff. """
143
137
        self.model.clear()
144
 
        if bzrlib.version_info < (0, 9):
145
 
            delta = compare_trees(self.old_tree, self.wt)
146
 
        else:
147
 
            delta = self.wt.changes_from(self.old_tree)
 
138
        delta = self.wt.changes_from(self.old_tree)
148
139
 
149
140
        self.model.append(None, [ _('Complete Diff'), "" ])
150
141