1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Yuya Nishihara  committed 22568cf

filectxactions: set up initial state of actions correctly (fixes #2255)

If initial rev is workingdir or patch, it needs to disable some actions.

  • Participants
  • Parent commits 958aca7
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/filectxactions.py

View file
                 act.triggered.connect(cb)
             self._actions[name] = act
 
+        self._updateActions()
+
     def setRepo(self, repo):
         self.repo = repo
 
     def setRev(self, rev):
         self.ctx = self.repo[rev]
+        self._updateActions()
+
+    def _updateActions(self):
+        rev = self.ctx.rev()
         real = type(rev) is int
         wd = rev is None
         for act in ['navigate', 'diffnavigate', 'ldiff', 'edit', 'save']: