Source

thg-qt-mq / revcontent-setsource.diff

# HG changeset patch
# Parent b1546e865eaa07d17e75f3a2c5f5d640879be4b0
revdetails: add RevContentView.setSource(path, rev) for manifest view

diff --git a/tortoisehg/hgqt/revdetails.py b/tortoisehg/hgqt/revdetails.py
--- a/tortoisehg/hgqt/revdetails.py
+++ b/tortoisehg/hgqt/revdetails.py
@@ -16,6 +16,7 @@ from tortoisehg.hgqt.fileview import HgF
 from tortoisehg.hgqt.revpanel import RevPanelWidget
 from tortoisehg.hgqt.revmessage import RevMessage
 from tortoisehg.hgqt import thgrepo
+from tortoisehg.util import hglib
 
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
@@ -326,3 +327,10 @@ class RevContentView(QFrame):
         self.revpanel.update()
         self.message.displayRevision(ctx)
         self.fileview.setContext(ctx)
+
+    @pyqtSlot(unicode, object)
+    def setSource(self, path, rev):
+        """Change path and revision to display [unicode]"""
+        self.setRev(rev)
+        self.fileview.displayFile(hglib.fromunicode(path),
+                                  self.repo[rev].p1().rev())