Commits

Yuya Nishihara committed 8644653

commit: make sure to clear last amend message on repository change (fixes #3467)

refresh() can switch the commit action and save the last message. But, the
saved 'amend' message must be cleared if refresh() is called in the middle of
repositoryChanged handler.

  • Participants
  • Parent commits 9f0d1bb
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/commit.py

     @pyqtSlot()
     def repositoryChanged(self):
         'Repository has detected a changelog / dirstate change'
+        # refresh() may save the stale 'amend' message in commitSetAction()
+        self.refresh()
+        self.stwidget.refreshWctx() # Trigger reload of working context
         # clear the last 'amend' message
         # do not clear the last 'commit' message because there are many cases
         # in which we may write a commit message first, modify the repository
         # (e.g. amend or update and merge uncommitted changes) and then do the
         # actual commit
         self.lastCommitMsgs['amend'] = ''
-        self.refresh()
-        self.stwidget.refreshWctx() # Trigger reload of working context
 
     @pyqtSlot()
     def refreshWctx(self):