Commits

Anonymous committed bea4af3

workbench: add "Goto revision" command

A simple text field for now. Entering an unknown revision will display an error
in the status bar.

The Qt.WindowTitleHint is used to prevent displaying a help link on Windows.

Comments (0)

Files changed (1)

tortoisehg/hgqt/workbench.py

         newaction(_("Load all revisions"), self.loadall,
                   enabled='repoopen', menu='view', shortcut='Shift+Ctrl+A',
                   tooltip=_('Load all revisions into graph'))
+        newaction(_("&Goto revision..."), self.gotorev,
+                  enabled='repoopen', menu='view', shortcut='Ctrl+Shift+G',
+                  tooltip=_('Go to a specific revision'))
 
         newaction(_("Web Server..."), self.serve, enabled='repoopen',
                   menu='repository')
         if w:
             w.repoview.model().loadall()
 
+    def gotorev(self):
+        rev, ok = QInputDialog.getText(self, "Goto revision",
+                                       "Enter revision identifier",
+                                       flags=Qt.WindowTitleHint)
+        w = self.repoTabsWidget.currentWidget()
+        if ok and w:
+            w.repoview.goto(rev)
+
     def newRepository(self):
         """ Run init dialog """
         from tortoisehg.hgqt.hginit import InitDialog