687
687
def _do_cancel(self):
688
688
"""If requested, saves commit messages when cancelling gcommit; they are re-used by a next gcommit"""
689
689
if can_save_commit_messages:
690
self._saved_commit_messages_manager = SavedCommitMessagesManager()
691
self._saved_commit_messages_manager.insert(self._get_global_commit_message(),
692
self._get_specific_files()[1])
693
if self._saved_commit_messages_manager.is_not_empty(): # maybe worth saving
694
response = question_dialog(_i18n('Commit cancelled'),
695
_i18n('Do you want to save your commit messages ?'),
690
mgr = SavedCommitMessagesManager()
691
self._saved_commit_messages_manager = mgr
692
mgr.insert(self._get_global_commit_message(),
693
self._get_specific_files()[1])
694
if mgr.is_not_empty(): # maybe worth saving
695
response = question_dialog(
696
_i18n('Commit cancelled'),
697
_i18n('Do you want to save your commit messages ?'),
697
699
if response == gtk.RESPONSE_NO:
698
700
# save nothing and destroy old comments if any
699
self._saved_commit_messages_manager = SavedCommitMessagesManager()
700
self._saved_commit_messages_manager.save(self._wt, self._wt.branch)
701
mgr = SavedCommitMessagesManager()
702
mgr.save(self._wt, self._wt.branch)
701
703
self.response(gtk.RESPONSE_CANCEL) # close window