Read about our upcoming Code of Conduct on this issue

Commit ec3022a7 authored by Steve Borho's avatar Steve Borho
Browse files

fileview: connect editSelected from the annotate widget

parent 1853af848454
......@@ -31,6 +31,7 @@ from PyQt4 import Qsci
from tortoisehg.util import hglib, patchctx
from tortoisehg.hgqt.i18n import _
from tortoisehg.hgqt import annotate, qscilib, qtlib, blockmatcher, lexers
from tortoisehg.hgqt import visdiff, wctxactions
qsci = Qsci.QsciScintilla
......@@ -46,9 +47,6 @@ class HgFileView(QFrame):
searchRequested = pyqtSignal(unicode)
"""Emitted (pattern) when user request to search content"""
editSelected = pyqtSignal(unicode, object, int)
"""Emitted (path, rev, line) when user requests to open editor"""
grepRequested = pyqtSignal(unicode, dict)
"""Emitted (pattern, opts) when user request to search changelog"""
......@@ -429,6 +427,15 @@ class HgFileView(QFrame):
def sourceChanged(self, path, rev, line=None):
self.revForDiffChanged.emit(rev)
@pyqtSlot(unicode, object, int)
def editSelected(self, path, rev, line):
"""Open editor to show the specified file"""
repo = self._ctx._repo
path = hglib.fromunicode(path)
base = visdiff.snapshot(repo, [path], repo[rev])[0]
files = [os.path.join(base, path)]
wctxactions.edit(self, repo.ui, repo, files, line, self._find_text)
def searchString(self, text):
self._find_text = text
self.clearHighlights()
......
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