34
34
import bzrlib.errors as errors
35
35
from bzrlib.workingtree import WorkingTree
37
from dialog import error_dialog
38
40
""" Display Commit dialog and perform the needed actions. """
39
def __init__(self, gladefile, wt, wtpath, dialog):
41
def __init__(self, gladefile, wt, wtpath):
40
42
""" Initialize the Commit dialog. """
41
43
self.gladefile = gladefile
42
44
self.glade = gtk.glade.XML(self.gladefile, 'window_commit', 'olive-gtk')
81
80
""" Display the Push dialog. """
83
self.dialog.error_dialog(_('Directory is not a branch'),
82
error_dialog(_('Directory is not a branch'),
84
83
_('You can perform this action only in a branch.'))
151
150
local=self.checkbutton_local.get_active(),
152
151
specific_files=specific_files)
153
152
except errors.NotBranchError:
154
self.dialog.error_dialog(_('Directory is not a branch'),
153
error_dialog(_('Directory is not a branch'),
155
154
_('You can perform this action only in a branch.'))
157
156
except errors.LocalRequiresBoundBranch:
158
self.dialog.error_dialog(_('Directory is not a checkout'),
157
error_dialog(_('Directory is not a checkout'),
159
158
_('You can perform local commit only on checkouts.'))
161
160
except errors.PointlessCommit:
162
self.dialog.error_dialog(_('No changes to commit'),
161
error_dialog(_('No changes to commit'),
163
162
_('Try force commit if you want to commit anyway.'))
165
164
except errors.ConflictsInTree:
166
self.dialog.error_dialog(_('Conflicts in tree'),
165
error_dialog(_('Conflicts in tree'),
167
166
_('You need to resolve the conflicts before committing.'))
169
168
except errors.StrictCommitFailed:
170
self.dialog.error_dialog(_('Strict commit failed'),
169
error_dialog(_('Strict commit failed'),
171
170
_('There are unknown files in the working tree.\nPlease add or delete them.'))
173
172
except errors.BoundBranchOutOfDate, errmsg:
174
self.dialog.error_dialog(_('Bound branch is out of date'),
173
error_dialog(_('Bound branch is out of date'),
175
174
_('%s') % errmsg)
177
176
except errors.BzrError, msg:
178
self.dialog.error_dialog(_('Unknown error'), str(msg))
177
error_dialog(_('Unknown error'), str(msg))