# HG changeset patch
# User Wagner Bruna <[email protected]>
# Date 1276815673 10800
# Node ID 775bcc1ace3777191d2b79e2466844c0c3ed5e06
# Parent 17424bc2c740f4f8fd6bdc63989020e300c2e352
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.
diff --git a/tortoisehg/hgtk/thgmq.py b/tortoisehg/hgtk/thgmq.py
--- a/tortoisehg/hgtk/thgmq.py
+++ b/tortoisehg/hgtk/thgmq.py
@@ -955,10 +955,12 @@
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)
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop