Commits

Yuya Nishihara  committed d9afad3

patches

  • Participants
  • Parent commits b148e39

Comments (0)

Files changed (3)

File repow-output-infobar.diff

+# HG changeset patch
+# Date 1378307160 -32400
+# Parent e534227f8ee31f5411423902fb9536ed4ce6afe1
+repowidget: capture all errors of repository commands to display on infobar
+
+XXX this smells bad.
+
+diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
+--- a/tortoisehg/hgqt/repowidget.py
++++ b/tortoisehg/hgqt/repowidget.py
+@@ -142,6 +142,8 @@ class RepoWidget(QWidget):
+             #       be negative
+             if widgetIndex > 0:
+                 self.taskTabsWidget.setCurrentIndex(widgetIndex)
++
++        self._repoagent.outputReceived.connect(self._showOutputOnInfoBar)
+         self.output.connect(self._showOutputOnInfoBar)
+ 
+     def setupUi(self):
+sing-useagent.diff
+repow-output-infobar.diff
 scintilla-compat.diff
 scintilla-stdmenu.diff
 win32sigpipe.diff

File sing-useagent.diff

+# HG changeset patch
+# Date 1378306716 -32400
+# Parent bfa366cd1d84fd65197819c9127b28d4b19bec29
+sign: use RepoAgent to run Mercurial command
+
+diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
+--- a/tortoisehg/hgqt/repowidget.py
++++ b/tortoisehg/hgqt/repowidget.py
+@@ -1888,7 +1888,6 @@ class RepoWidget(QWidget):
+     def signRevision(self):
+         dlg = sign.SignDialog(self._repoagent, self.rev, self)
+         dlg.showMessage.connect(self.showMessage)
+-        dlg.output.connect(self.output)
+         dlg.makeLogVisible.connect(self.makeLogVisible)
+         dlg.exec_()
+ 
+diff --git a/tortoisehg/hgqt/sign.py b/tortoisehg/hgqt/sign.py
+--- a/tortoisehg/hgqt/sign.py
++++ b/tortoisehg/hgqt/sign.py
+@@ -12,11 +12,10 @@ from mercurial import util
+ 
+ from tortoisehg.util import hglib
+ from tortoisehg.hgqt.i18n import _
+-from tortoisehg.hgqt import qtlib, cmdui
++from tortoisehg.hgqt import qtlib
+ 
+ class SignDialog(QDialog):
+     showMessage = pyqtSignal(QString)
+-    output = pyqtSignal(QString, QString)
+     makeLogVisible = pyqtSignal(bool)
+ 
+     def __init__(self, repoagent, rev='tip', parent=None, opts={}):
+@@ -104,11 +103,6 @@ class SignDialog(QDialog):
+         self.status.setContentsMargins(4, 2, 4, 4)
+         self.layout().addWidget(self.status)
+ 
+-        self.cmd = cmdui.Runner(False, self)
+-        self.cmd.output.connect(self.output)
+-        self.cmd.makeLogVisible.connect(self.makeLogVisible)
+-        self.cmd.commandFinished.connect(self.commandFinished)
+-
+         # prepare to show
+         self.setWindowTitle(_('Sign - %s') % repo.displayname)
+         self.setWindowIcon(qtlib.geticon('hg-sign'))
+@@ -155,6 +149,8 @@ class SignDialog(QDialog):
+     def commandFinished(self, ret):
+         if ret == 0:
+             self.set_status(_("Signature has been added"))
++        else:
++            self.makeLogVisible.emit(True)
+ 
+     @pyqtSlot()
+     def updateStates(self):
+@@ -164,7 +160,7 @@ class SignDialog(QDialog):
+         self.customTextLineEdit.setEnabled(not nocommit and custom)
+ 
+     def onSign(self):
+-        if self.cmd.core.running():
++        if self._repoagent.isBusy():
+             self.set_status(_('Repository command still running'), False)
+             return
+ 
+@@ -183,7 +179,7 @@ class SignDialog(QDialog):
+         if not user:
+             return
+ 
+-        cmd = ['sign', '--repository', self.repo.root, '--user', user]
++        cmd = ['sign', '--user', user]
+ 
+         if key:
+             cmd.append('--key=%s' % key)
+@@ -201,7 +197,8 @@ class SignDialog(QDialog):
+                 cmd.append('--message=%s' % msg)
+ 
+         cmd.append(str(self.rev))
+-        self.cmd.run(cmd)
++        sess = self._repoagent.runCommand(map(hglib.tounicode, cmd), self)
++        sess.commandFinished.connect(self.commandFinished)
+ 
+     def customMessageToggle(self, checked):
+         self.customTextLineEdit.setEnabled(checked)