Source

thg-qt-mq / revcontent-setrev.diff

Yuya Nishihara 1276161 





































# HG changeset patch
# Parent 3eaee0619a197f11a1980b6bec5efc9d523416ca
revdetails: implement setRev(rev) on RevContentView


diff --git a/tortoisehg/hgqt/revdetails.py b/tortoisehg/hgqt/revdetails.py
--- a/tortoisehg/hgqt/revdetails.py
+++ b/tortoisehg/hgqt/revdetails.py
@@ -209,16 +209,13 @@ class RevDetailsWidget(QWidget):
 
     def revision_selected(self, rev):
         self._last_rev = rev
+        self.cset_and_file_details_frame.setRev(rev)
         ctx = thgrepo.getcontext(self.repo, rev)
-        self.revpanel.set_revision(rev)
-        self.revpanel.update()
-        self.message.displayRevision(ctx)
         if type(ctx.rev()) == str:
             self.actionDiffMode.setChecked(True)
             self.actionDiffMode.setEnabled(False)
         else:
             self.actionDiffMode.setEnabled(True)
-        self.fileview.setContext(ctx)
         self.filelistmodel.setContext(ctx)
 
         mode = self.getMode()
@@ -322,3 +319,12 @@ class RevContentView(QFrame):
 
         cset_and_file_details_layout.addWidget(self.revpanel)
         cset_and_file_details_layout.addWidget(self.message_splitter)
+
+    @pyqtSlot(object)
+    def setRev(self, rev):
+        """Change the revision to display"""
+        ctx = thgrepo.getcontext(self.repo, rev)
+        self.revpanel.set_revision(rev)
+        self.revpanel.update()
+        self.message.displayRevision(ctx)
+        self.fileview.setContext(ctx)