/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/push.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")
27
29
import bzrlib.errors as errors
28
30
 
29
31
from olive import gladefile
30
 
from dialog import error_dialog, info_dialog
31
32
 
32
33
class OlivePush:
33
34
    """ Display Push dialog and perform the needed actions. """
104
105
                               overwrite=self.check_overwrite.get_active())
105
106
            except errors.NotBranchError:
106
107
                error_dialog(_('Directory is not a branch'),
107
 
                             _('You can perform this action only in a branch.'))
 
108
                                         _('You can perform this action only in a branch.'))
108
109
                return
109
110
            except errors.DivergedBranches:
110
111
                error_dialog(_('Branches have been diverged'),
111
 
                             _('You cannot push if branches have diverged. Use the\noverwrite option if you want to push anyway.'))
 
112
                                         _('You cannot push if branches have diverged. Use the\noverwrite option if you want to push anyway.'))
112
113
                return
113
114
        elif self.radio_specific.get_active():
114
115
            location = self.entry_location.get_text()
115
116
            if location == '':
116
117
                error_dialog(_('No location specified'),
117
 
                             _('Please specify a location or use the default.'))
 
118
                                         _('Please specify a location or use the default.'))
118
119
                return
119
120
            
120
121
            try:
124
125
                               self.check_create.get_active())
125
126
            except errors.NotBranchError:
126
127
                error_dialog(_('Directory is not a branch'),
127
 
                             _('You can perform this action only in a branch.'))
 
128
                                         _('You can perform this action only in a branch.'))
128
129
                return
129
130
            except errors.DivergedBranches:
130
131
                error_dialog(_('Branches have been diverged'),
131
 
                             _('You cannot push if branches have diverged. Use the\noverwrite option if you want to push anyway.'))
 
132
                                         _('You cannot push if branches have diverged. Use the\noverwrite option if you want to push anyway.'))
132
133
                return
133
134
        
134
135
        self.close()
135
136
        info_dialog(_('Push successful'),
136
 
                    _('%d revision(s) pushed.') % revs)
 
137
                                _('%d revision(s) pushed.') % revs)
137
138
    
138
139
    def test(self, widget):
139
140
        """ Test if write access possible. """
215
216
                transport.mkdir(relurl)
216
217
            except errors.NoSuchFile:
217
218
                error_dialog(_('Non existing parent directory'),
218
 
                             _("The parent directory (%s)\ndoesn't exist.") % location)
 
219
                                         _("The parent directory (%s)\ndoesn't exist.") % location)
219
220
                return
220
221
        else:
221
222
            current = transport.base
231
232
                                   new_transport.relpath(transport.base)))
232
233
                    if new_transport.base == transport.base:
233
234
                        error_dialog(_('Path prefix not created'),
234
 
                                     _("The path leading up to the specified location couldn't\nbe created."))
 
235
                                                 _("The path leading up to the specified location couldn't\nbe created."))
235
236
                        return
236
237
        dir_to = br_from.bzrdir.clone(location_url,
237
238
            revision_id=br_from.last_revision())