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

  • Committer: Jelmer Vernooij
  • Date: 2007-03-20 20:44:53 UTC
  • Revision ID: jelmer@samba.org-20070320204453-xtfjioh0ooy1tta9
Don't make the user worry about strict commit unless we actually find unknown files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        
91
91
        # Create the widgets
92
92
        self._button_commit = gtk.Button(_("Comm_it"), use_underline=True)
93
 
        self._check_strict = gtk.CheckButton(_("_Allow unknown files"),
94
 
                                             use_underline=True)
95
93
        self._expander_files = gtk.Expander(_("File(s) to commit"))
96
94
        self._vpaned_main = gtk.VPaned()
97
95
        self._scrolledwindow_files = gtk.ScrolledWindow()
156
154
            if have_nm:
157
155
                # 3 is the enum value for STATE_CONNECTED
158
156
                self._check_local.set_active(dbus_iface.state() != 3)
159
 
        self.vbox.pack_start(self._check_strict, False, False)
160
157
        
161
158
        # Create the file list
162
159
        self._create_file_view()
220
217
            local = self._check_local.get_active()
221
218
        else:
222
219
            local = False
 
220
 
 
221
        if list(self.wt.unknowns()) != []:
 
222
            response = question_dialog(_("Commit with unknowns?"),
 
223
               _("Unknown files exist in the working tree. Commit anyway?"))
 
224
            if response == gtk.RESPONSE_NO:
 
225
                return
223
226
        
224
227
        try:
225
228
            self.wt.commit(message,
226
229
                       allow_pointless=False,
227
 
                       strict=self._check_strict.get_active(),
 
230
                       strict=False,
228
231
                       local=local,
229
232
                       specific_files=specific_files)
230
233
        except errors.PointlessCommit:
233
236
            if response == gtk.RESPONSE_YES:
234
237
                self.wt.commit(message,
235
238
                               allow_pointless=True,
236
 
                               strict=self._check_strict.get_active(),
 
239
                               strict=False,
237
240
                               local=local,
238
241
                               specific_files=specific_files)
239
242
        self.response(gtk.RESPONSE_OK)