1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Yuya Nishihara  committed 44132ac

repowidget: test existence of mqDemand explicitly (fixes #2048)

repo.extensions() may change after RepoWidget is instantiated.

  • Participants
  • Parent commits caadeb1
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/repowidget.py

View file
  • Ignore whitespace
             tt.setTabToolTip(idx, _("MQ Patch", "tab tooltip"))
             self.namedTabs['mq'] = idx
         else:
+            self.mqDemand = None
             self.mqTabIndex = -1
 
         self.syncDemand = w = DemandWidget('createSyncWidget', self)
             self.taskTabsWidget.setCurrentIndex(self.syncTabIndex)
             self.showMessage(_('Sync tab cannot exit'))
             return False
-        if 'mq' in self.repo.extensions():
+        if self.mqDemand:
             if not self.mqDemand.canExit():
                 self.taskTabsWidget.setCurrentIndex(self.mqTabIndex)
                 self.showMessage(_('MQ tab cannot exit'))