1. Yuya Nishihara
  2. thg-work

Commits

Wagner Bruna  committed ea28e2d

thgmq: avoid looking up patch names as revisions

Unapplied patch names like 'abc' could be mistaken as revisions,
changing the selected revision unexpectedly when clicked.

  • Participants
  • Parent commits 9c3f7f9
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgtk/thgmq.py

View file
         if row[MQ_INDEX] < 0:
             return
         patchname = row[MQ_NAME]
-        try:
-            ctx = self.repo[patchname]
-            revid = ctx.rev()
-        except (error.RepoError, error.RepoLookupError, error.LookupError):
+        q = self.repo.mq
+        q.parse_series()
+        applied = q.isapplied(patchname)
+        if applied:
+            revid = self.repo[applied[1]].rev()
+        else:
             revid = -1
         self.emit('patch-selected', revid, patchname)