From af0f666b49fe5d43f12019516dd2c1f6f505cd5b Mon Sep 17 00:00:00 2001 From: Matt Harbison Date: Fri, 5 Apr 2019 21:37:16 -0400 Subject: [PATCH] revdetails: fix a crash when clicking a hash hyperlink in File History When clicking on a cset hyperlink in File History > Revision Details, this popped up: Traceback (most recent call last): File "tortoisehg\hgqt\revdetails.pyo", line 603, in linkActivated File "tortoisehg\hgqt\revdetails.pyo", line 562, in setRev File "tortoisehg\hgqt\revdetails.pyo", line 298, in onRevisionSelected File "tortoisehg\hgqt\thgrepo.pyo", line 772, in __getitem__ File "mercurial\localrepo.pyo", line 1277, in __getitem__ ProgrammingError: unsupported changeid 'c62038d6f988' of type Most of the existing callers pass an int to setRev(), with the possible exception of the default parameter in the RevDetailsDialog constructor. So this can't be converted any closer to the repo lookup. --HG-- branch : stable --- tortoisehg/hgqt/revdetails.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tortoisehg/hgqt/revdetails.py b/tortoisehg/hgqt/revdetails.py index b2649e962..460de4ae8 100644 --- a/tortoisehg/hgqt/revdetails.py +++ b/tortoisehg/hgqt/revdetails.py @@ -10,6 +10,10 @@ from __future__ import absolute_import import os +from mercurial import ( + scmutil, +) + from .qtcore import ( QEvent, QPoint, @@ -594,7 +598,11 @@ class RevDetailsDialog(QDialog): @pyqtSlot(str) def linkActivated(self, link): - handlers = {'cset': self.setRev, + def _torev(cset): + return scmutil.revsymbol(self._repoagent.rawRepo(), + hglib.fromunicode(cset)) + + handlers = {'cset': lambda cset: self.setRev(_torev(cset)), 'repo': self._showRepoInWorkbench} if ':' in link: scheme, param = link.split(':', 1) -- GitLab