Commits

Yuya Nishihara  committed ccfa14f

qtapp: add utility method to open repository in workbench

  • Participants
  • Parent commits 9ba76ea

Comments (0)

Files changed (1)

File tortoisehg/hgqt/qtapp.py

         assert not self._workbench
         self._workbench = workbench.Workbench()
         return self._workbench
+
+    def showRepoInWorkbench(self, uroot, rev=-1):
+        """Show the specified repository in Workbench"""
+        assert self._mainapp
+        if not self._workbench:
+            self._opendialog(lambda ui: self.createWorkbench(), [], {})
+            assert self._workbench
+
+        wb = self._workbench
+        wb.show()
+        wb.activateWindow()
+        wb.raise_()
+        wb.showRepo(uroot)
+        if rev != -1:
+            wb.goto(hglib.fromunicode(uroot), rev)