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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-30 13:04:15 UTC
  • mto: (0.14.3 main)
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060930130415-aba4100709e11f0a
Loads of fixes. Pyflakes cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
import sys
18
 
 
19
17
try:
20
18
    import pygtk
21
19
    pygtk.require("2.0")
22
20
except:
23
21
    pass
24
 
try:
25
 
    import gtk
26
 
    import gtk.glade
27
 
    import gobject
28
 
    import pango
29
 
except:
30
 
    sys.exit(1)
31
22
 
32
 
from bzrlib import version_info
 
23
import gtk
 
24
import gtk.glade
 
25
import gobject
 
26
import pango
33
27
 
34
28
import bzrlib.errors as errors
35
 
from bzrlib.workingtree import WorkingTree
36
29
 
37
30
from dialog import error_dialog
 
31
from olive import gladefile
38
32
 
39
33
class OliveCommit:
40
34
    """ Display Commit dialog and perform the needed actions. """
41
 
    def __init__(self, gladefile, wt, wtpath):
 
35
    def __init__(self, wt, wtpath):
42
36
        """ Initialize the Commit dialog. """
43
 
        self.gladefile = gladefile
44
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_commit', 'olive-gtk')
 
37
        self.glade = gtk.glade.XML(gladefile, 'window_commit', 'olive-gtk')
45
38
        
46
39
        self.wt = wt
47
40
        self.wtpath = wtpath
61
54
        
62
55
        # Set the delta
63
56
        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
64
 
        if version_info < (0, 9):
65
 
            self.delta = compare_trees(self.old_tree, self.wt)
66
 
        else:
67
 
            self.delta = self.wt.changes_from(self.old_tree)
 
57
        self.delta = self.wt.changes_from(self.old_tree)
68
58
        
69
59
        # Dictionary for signal_autoconnect
70
60
        dic = { "on_button_commit_commit_clicked": self.commit,
80
70
        """ Display the Push dialog. """
81
71
        if self.notbranch:
82
72
            error_dialog(_('Directory is not a branch'),
83
 
                                     _('You can perform this action only in a branch.'))
 
73
                         _('You can perform this action only in a branch.'))
84
74
            self.close()
85
75
        else:
86
76
            if self.wt.branch.get_bound_location() is not None:
127
117
            it = self.file_store.iter_next(it)
128
118
 
129
119
        return ret
130
 
    # end of bzr-gtk code
131
120
    
132
121
    def _toggle_commit(self, cell, path, model):
133
122
        model[path][0] = not model[path][0]
151
140
                           specific_files=specific_files)
152
141
        except errors.NotBranchError:
153
142
            error_dialog(_('Directory is not a branch'),
154
 
                                     _('You can perform this action only in a branch.'))
 
143
                         _('You can perform this action only in a branch.'))
155
144
            return
156
145
        except errors.LocalRequiresBoundBranch:
157
146
            error_dialog(_('Directory is not a checkout'),
158
 
                                     _('You can perform local commit only on checkouts.'))
 
147
                         _('You can perform local commit only on checkouts.'))
159
148
            return
160
149
        except errors.PointlessCommit:
161
150
            error_dialog(_('No changes to commit'),
162
 
                                     _('Try force commit if you want to commit anyway.'))
 
151
                         _('Try force commit if you want to commit anyway.'))
163
152
            return
164
153
        except errors.ConflictsInTree:
165
154
            error_dialog(_('Conflicts in tree'),
166
 
                                     _('You need to resolve the conflicts before committing.'))
 
155
                         _('You need to resolve the conflicts before committing.'))
167
156
            return
168
157
        except errors.StrictCommitFailed:
169
158
            error_dialog(_('Strict commit failed'),
170
 
                                     _('There are unknown files in the working tree.\nPlease add or delete them.'))
 
159
                         _('There are unknown files in the working tree.\nPlease add or delete them.'))
171
160
            return
172
161
        except errors.BoundBranchOutOfDate, errmsg:
173
162
            error_dialog(_('Bound branch is out of date'),
174
 
                                     _('%s') % errmsg)
 
163
                         _('%s') % errmsg)
175
164
            return
176
165
        except errors.BzrError, msg:
177
166
            error_dialog(_('Unknown bzr error'), str(msg))
181
170
            return
182
171
        
183
172
        self.close()
184
 
        self.comm.refresh_right()
185
173
        
186
174
    def close(self, widget=None):
187
175
        self.window.destroy()