tortoisehg / stable (http://tortoisehg.bitbucket.org/)

TortoiseHg repository. Main line of development in "default" branch. Releases, bugfixes, and documentation improvements in "stable" branch.

Clone this repository (size: 23.9 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/tortoisehg/stable/
commit 3114: c3647813ddd0
parent 3112: 4e02beaf36d8
branch: default
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
Steve Borho / sborho
7 months ago

Changed (Δ444 bytes):

raw changeset »

hggtk/visdiff.py (12 lines added, 1 lines removed)

Up to file-list hggtk/visdiff.py:

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