/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: Jelmer Vernooij
  • Date: 2006-09-30 10:21:43 UTC
  • Revision ID: jelmer@samba.org-20060930102143-c0ef64d6ca860c21
Merge some files from Olive and bzr-gtk.

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
 
17
19
try:
18
20
    import pygtk
19
21
    pygtk.require("2.0")
20
22
except:
21
23
    pass
22
 
 
23
24
import gtk
24
25
import gtk.glade
25
26
import gobject
26
27
import pango
27
28
 
 
29
from bzrlib import version_info
 
30
 
28
31
import bzrlib.errors as errors
 
32
from bzrlib.workingtree import WorkingTree
29
33
 
30
34
from dialog import error_dialog
31
35
from olive import gladefile
32
36
 
33
 
class CommitDialog:
 
37
class OliveCommit:
34
38
    """ Display Commit dialog and perform the needed actions. """
35
39
    def __init__(self, wt, wtpath):
36
40
        """ Initialize the Commit dialog. """
70
74
        """ Display the Push dialog. """
71
75
        if self.notbranch:
72
76
            error_dialog(_('Directory is not a branch'),
73
 
                         _('You can perform this action only in a branch.'))
 
77
                                     _('You can perform this action only in a branch.'))
74
78
            self.close()
75
79
        else:
76
80
            if self.wt.branch.get_bound_location() is not None:
140
144
                           specific_files=specific_files)
141
145
        except errors.NotBranchError:
142
146
            error_dialog(_('Directory is not a branch'),
143
 
                         _('You can perform this action only in a branch.'))
 
147
                                     _('You can perform this action only in a branch.'))
144
148
            return
145
149
        except errors.LocalRequiresBoundBranch:
146
150
            error_dialog(_('Directory is not a checkout'),
147
 
                         _('You can perform local commit only on checkouts.'))
 
151
                                     _('You can perform local commit only on checkouts.'))
148
152
            return
149
153
        except errors.PointlessCommit:
150
154
            error_dialog(_('No changes to commit'),
151
 
                         _('Try force commit if you want to commit anyway.'))
 
155
                                     _('Try force commit if you want to commit anyway.'))
152
156
            return
153
157
        except errors.ConflictsInTree:
154
158
            error_dialog(_('Conflicts in tree'),
155
 
                         _('You need to resolve the conflicts before committing.'))
 
159
                                     _('You need to resolve the conflicts before committing.'))
156
160
            return
157
161
        except errors.StrictCommitFailed:
158
162
            error_dialog(_('Strict commit failed'),
159
 
                         _('There are unknown files in the working tree.\nPlease add or delete them.'))
 
163
                                     _('There are unknown files in the working tree.\nPlease add or delete them.'))
160
164
            return
161
165
        except errors.BoundBranchOutOfDate, errmsg:
162
166
            error_dialog(_('Bound branch is out of date'),
163
 
                         _('%s') % errmsg)
 
167
                                     _('%s') % errmsg)
164
168
            return
165
169
        except errors.BzrError, msg:
166
170
            error_dialog(_('Unknown bzr error'), str(msg))