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