Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8.1, 0.8.2, and 0.8.3

vdiff: catch IOErrors when deleting tempfiles

Try to do something sane when the user closes the visual diff
dialog while diff tools hold files open (only an issue on
Windows where you cannot typically delete open files).

Fixes #362

Changeset c3647813ddd0

Parent 4e02beaf36d8

by Steve Borho

Changes to one file · Browse files at c3647813ddd0 Showing diff from parent 4e02beaf36d8 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​visdiff.py Stacked
 
205
206
207
208
 
 
 
 
 
 
 
 
 
 
 
 
209
210
211
 
205
206
207
 
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
@@ -205,7 +205,18 @@
  vsettings = settings.Settings('visdiff')   vsettings.set_value('launchsingle', self.singlecheck.get_active())   vsettings.write() - shutil.rmtree(tmproot) + while True: + try: + shutil.rmtree(tmproot) + return + except IOError: + resp = gdialog.CustomPrompt(_('Unable to delete temp files'), + _('Close diff tools and try again, or quit to leak files?'), + self, (_('Try &Again'), _('&Quit')), _('q')).run() + if resp == ord(_('a')): + continue + else: + return     def rowactivated(self, tree, path, column):   selection = tree.get_selection()