Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

commit: ask for add/remove confirmation

Changeset 9ef223aa496d

Parent 81e2e372dbbc

by Steve Borho

Changes to one file · Browse files at 9ef223aa496d Showing diff from parent 81e2e372dbbc Diff from another changeset...

 
20
21
22
23
24
25
 
26
27
28
 
174
175
176
 
177
178
179
 
181
182
183
184
 
185
186
187
 
 
188
189
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
192
 
193
194
195
 
20
21
22
 
 
 
23
24
25
26
 
172
173
174
175
176
177
178
 
180
181
182
 
183
184
 
 
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
 
213
214
215
216
@@ -20,9 +20,7 @@
 # Technical Debt for CommitWidget  # qrefresh support  # threaded / wrapped commit (need a CmdRunner equivalent) -# qctlib decode failure dialog (ask for locale, suggest HGENCODING) -# auto-add unknown files -# auto-rem missing files +# qctlib decode failure dialog (ask for retry locale, suggest HGENCODING)  # add rollback function with prompt  # +1 / -1 head indication (not as important with workbench integration)  # hook up username from command line to username combo @@ -174,6 +172,7 @@
  self.msgcombo.reset(self.msghistory)     def commit(self): + ui = self.stwidget.repo.ui   msg = self.getMessage()   if not msg:   qtlib.WarningMsgBox(_('Nothing Commited'), @@ -181,15 +180,37 @@
  parent=self)   self.msgte.setFocus()   return - files = self.stwidget.getChecked() + files = self.stwidget.getChecked('MAR?!S')   if not files: - qtlib.WarningMsgBox(_('No files selected'), - _('No operation to perform'), + qtlib.WarningMsgBox(_('No files checked'), + _('No modified files checkmarked for commit'),   parent=self)   self.stwidget.tv.setFocus()   return + checkedUnknowns = self.stwidget.getChecked('?I') + if checkedUnknowns: + res = qtlib.CustomPrompt( + _('Confirm Add'), + _('Add checked untracked files?'), self, + (_('&Ok'), ('&Cancel')), 0, 1, + checkedUnknowns).run() + if res == 0: + dispatch._dispatch(ui, ['add'] + checkedUnknowns) + else: + return + checkedMissing = self.stwidget.getChecked('!') + if checkedMissing: + res = qtlib.CustomPrompt( + _('Confirm Remove'), + _('Remove checked deleted files?'), self, + (_('&Ok'), ('&Cancel')), 0, 1, + checkedMissing).run() + if res == 0: + dispatch._dispatch(ui, ['remove'] + checkedMissing) + else: + return   cmdline = ['commit', '--message', msg] + files - ret = dispatch._dispatch(self.stwidget.repo.ui, cmdline) + ret = dispatch._dispatch(ui, cmdline)   if not ret:   self.addMessageToHistory()   self.msgte.clear()