Commit af0f666b authored by Matt Harbison's avatar Matt Harbison

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 <type 'unicode'>

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
parent bdcc8e792a40
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment