Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

archive: confirm overwrite if the file already exists

Changeset 117a5ebf97f7

Parent 442801050ab8

by Yuki KODAMA

Changes to one file · Browse files at 117a5ebf97f7 Showing diff from parent 442801050ab8 Diff from another changeset...

 
214
215
216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
218
219
220
221
222
223
224
 
 
225
226
227
 
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
 
 
240
241
242
243
244
@@ -214,14 +214,31 @@
  self.abortbtn.set_property('visible', working)     def archive(self): + # verify input + select = self.get_selected_archive_type() + dest = self.destentry.get_text() + if os.path.exists(dest): + if select['type'] != 'files': + ret = gdialog.Confirm(_('Confirm Overwrite'), [], self, + _('The destination "%s" already exists!\n\n' + 'Do you want to overwrite it?') % dest).run() + if ret != gtk.RESPONSE_YES: + return False + elif len(os.listdir(dest)) > 0: + ret = gdialog.Confirm(_('Confirm Overwrite'), [], self, + _('The directory "%s" isn\'t empty!\n\n' + 'Do you want to overwrite it?') % dest).run() + if ret != gtk.RESPONSE_YES: + return False +   cmdline = ['hg', 'archive', '--verbose']   rev = self.combo.get_active_text()   if rev != WD_PARENT:   cmdline.append('--rev')   cmdline.append(rev)   cmdline.append('-t') - cmdline.append(self.get_selected_archive_type()['type']) - cmdline.append(hglib.fromutf(self.destentry.get_text())) + cmdline.append(select['type']) + cmdline.append(hglib.fromutf(dest))     def cmd_done(returncode):   self.switch_to(MODE_NORMAL, cmd=False)