Steve Borho avatar Steve Borho committed 28a30e8

commit: ignore IOError when saving state (fixes #2202)

Comments (0)

Files changed (1)

tortoisehg/hgqt/commit.py

 
     def saveSettings(self, s, prefix):
         'Save history, etc, in QSettings instance'
-        repoid = str(self.repo[0])
-        lpref = prefix + '/commit/'
-        gpref = 'commit/'
-        s.setValue(lpref+'split', self.split.saveState())
-        self.msgte.saveSettings(s, lpref+'msgte')
-        self.stwidget.saveSettings(s, lpref+'status')
-        s.setValue(gpref+'history-'+repoid, self.msghistory)
-        s.setValue(gpref+'userhist', self.userhist)
-        msg = self.getMessage(True)
         try:
+            repoid = str(self.repo[0])
+            lpref = prefix + '/commit/'
+            gpref = 'commit/'
+            s.setValue(lpref+'split', self.split.saveState())
+            self.msgte.saveSettings(s, lpref+'msgte')
+            self.stwidget.saveSettings(s, lpref+'status')
+            s.setValue(gpref+'history-'+repoid, self.msghistory)
+            s.setValue(gpref+'userhist', self.userhist)
+            msg = self.getMessage(True)
             self.repo.opener('cur-message.txt', 'w').write(msg)
-        except EnvironmentError:
+        except (EnvironmentError, IOError):
             pass
 
     def addMessageToHistory(self, umsg):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.