Commits

Steve Borho  committed 2e0bb0b

repowidget: pass tags to menu enable logic, improve qgoto selection

Allow qgoto if revision is 'qparent' or it is an applied patch, unless the
applied patch is already qtip.

  • Participants
  • Parent commits 955f4b2
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/repowidget.py

     def singleSelectionMenu(self, point, selection):
         ctx = self.repo.changectx(self.rev)
         applied = ctx.thgmqappliedpatch()
-        qparent = 'qparent' in ctx.tags()
         working = self.rev is None
+        tags = ctx.tags()
 
         for item in self.singlecmenuitems:
-            enabled = item.enableFunc(applied, qparent, working)
+            enabled = item.enableFunc(applied, working, tags)
             item.setEnabled(enabled)
 
         self.singlecmenu.exec_(point)
         # fixed = the changeset is considered permanent
         # applid = an applied patch
         # qgoto = applied patch or qparent
-        isrev   = lambda ap, qp, wd: not wd
-        isctx   = lambda ap, qp, wd: True
-        fixed   = lambda ap, qp, wd: not (ap or wd)
-        applied = lambda ap, qp, wd: ap
-        qgoto   = lambda ap, qp, wd: qp or ap
+        isrev   = lambda ap, wd, tags: not wd
+        isctx   = lambda ap, wd, tags: True
+        fixed   = lambda ap, wd, tags: not (ap or wd)
+        applied = lambda ap, wd, tags: ap
+        qgoto   = lambda ap, wd, tags: ('qparent' in tags) or \
+                                       (ap and ('qtip' not in tags))
 
         exs = self.repo.extensions()
         menu = QMenu(self)