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

  • Committer: Jasper Groenewegen
  • Date: 2008-07-27 12:01:40 UTC
  • mfrom: (576.3.2 improve-merge)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: colbrac@xs4all.nl-20080727120140-1agdlzkc9fumjk5f
Merge merge dialog improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from bzrlib.config import LocationConfig
31
31
import bzrlib.errors as errors
32
32
 
 
33
from bzrlib.plugins.gtk import _i18n
33
34
from dialog import error_dialog, info_dialog, question_dialog
34
35
 
35
36
from history import UrlHistory
49
50
        self.branch = branch
50
51
        
51
52
        # Create the widgets
52
 
        self._label_location = gtk.Label(_("Location:"))
 
53
        self._label_location = gtk.Label(_i18n("Location:"))
53
54
        self._combo = gtk.ComboBoxEntry()
54
 
        self._button_push = gtk.Button(_("_Push"), use_underline=True)
 
55
        self._button_push = gtk.Button(_i18n("_Push"), use_underline=True)
55
56
        self._hbox_location = gtk.HBox()
56
57
        
57
58
        # Set callbacks
93
94
        """ Push button clicked handler. """
94
95
        location = self._combo.get_child().get_text()
95
96
        revs = 0
96
 
        if self.branch is not None and self.branch.get_push_location() is None:
97
 
            response = question_dialog(_('Set default push location'),
98
 
                                       _('There is no default push location set.\nSet %r as default now?') % location)
99
 
            if response == gtk.RESPONSE_OK:
100
 
                self.branch.set_push_location(location)
101
 
 
 
97
        
102
98
        try:
103
99
            revs = do_push(self.branch, location=location, overwrite=False)
104
100
        except errors.DivergedBranches:
105
 
            response = question_dialog(_('Branches have been diverged'),
106
 
                                       _('You cannot push if branches have diverged.\nOverwrite?'))
107
 
            if response == gtk.RESPONSE_OK:
 
101
            response = question_dialog(_i18n('Branches have been diverged'),
 
102
                                       _i18n('You cannot push if branches have diverged.\nOverwrite?'))
 
103
            if response == gtk.RESPONSE_YES:
108
104
                revs = do_push(self.branch, location=location, overwrite=True)
109
 
            return
 
105
        
 
106
        if self.branch is not None and self.branch.get_push_location() is None:
 
107
            self.branch.set_push_location(location)
110
108
        
111
109
        self._history.add_entry(location)
112
 
        info_dialog(_('Push successful'),
113
 
                    _("%d revision(s) pushed.") % revs)
 
110
        info_dialog(_i18n('Push successful'),
 
111
                    _i18n("%d revision(s) pushed.") % revs)
114
112
        
115
113
        self.response(gtk.RESPONSE_OK)
116
114
 
143
141
            relurl = transport.relpath(location_url)
144
142
            transport.mkdir(relurl)
145
143
        except errors.NoSuchFile:
146
 
            response = question_dialog(_('Non existing parent directory'),
147
 
                         _("The parent directory (%s)\ndoesn't exist. Create?") % location)
 
144
            response = question_dialog(_i18n('Non existing parent directory'),
 
145
                         _i18n("The parent directory (%s)\ndoesn't exist. Create?") % location)
148
146
            if response == gtk.RESPONSE_OK:
149
147
                _create_prefix(transport)
150
148
            else: