1. Yuya Nishihara
  2. thg-qt-mq

Commits

Yuya Nishihara  committed 4362a19

show sign error

  • Participants
  • Parent commits 4dbe147
  • Branches default

Comments (0)

Files changed (5)

File cmdcore-caperr.diff

View file
  • Ignore whitespace
  
 +    @pyqtSlot(unicode, unicode)
 +    def _captureErrorOutput(self, msg, label):
-+        if label == 'ui.error':
++        if 'ui.error' in unicode(label).split():
 +            self._erroroutputs.append(unicode(msg))
 +
  

File series

View file
  • Ignore whitespace
 cmdcore-sessrunning.diff
 cmdcore-sessabort.diff
 cmdcore-caperr.diff
+sign-useagent.diff
+sign-showerror.diff
 cmdcore-sessqueue.diff
-sing-useagent.diff
 repow-output-infobar.diff
 scintilla-compat.diff
 scintilla-stdmenu.diff

File sign-showerror.diff

View file
  • Ignore whitespace
+# HG changeset patch
+# Date 1378384992 -32400
+# Parent 58cb429a2f634f6c9adeff1d5a9edb5ab42e0902
+
+diff --git a/tortoisehg/hgqt/sign.py b/tortoisehg/hgqt/sign.py
+--- a/tortoisehg/hgqt/sign.py
++++ b/tortoisehg/hgqt/sign.py
+@@ -24,6 +24,7 @@ class SignDialog(QDialog):
+                             ~Qt.WindowContextHelpButtonHint)
+ 
+         self._repoagent = repoagent
++        self._cmdsess = None
+         repo = repoagent.rawRepo()
+         self.rev = rev
+ 
+@@ -150,7 +151,9 @@ class SignDialog(QDialog):
+         if ret == 0:
+             self.set_status(_("Signature has been added"))
+         else:
++            self.set_status(self._cmdsess.errorString(), False)
+             self.makeLogVisible.emit(True)
++        self._cmdsess = None
+ 
+     @pyqtSlot()
+     def updateStates(self):
+@@ -198,6 +201,7 @@ class SignDialog(QDialog):
+ 
+         cmd.append(str(self.rev))
+         sess = self._repoagent.runCommand(map(hglib.tounicode, cmd), self)
++        self._cmdsess = sess
+         sess.commandFinished.connect(self.commandFinished)
+ 
+     def customMessageToggle(self, checked):

File sign-useagent.diff

View file
  • Ignore whitespace
+# HG changeset patch
+# Date 1378306716 -32400
+# Parent bfa366cd1d84fd65197819c9127b28d4b19bec29
+sign: use RepoAgent to run Mercurial command
+
+XXX show command error as status message
+
+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)

File sing-useagent.diff

  • Ignore whitespace
-# HG changeset patch
-# Date 1378306716 -32400
-# Parent bfa366cd1d84fd65197819c9127b28d4b19bec29
-sign: use RepoAgent to run Mercurial command
-
-XXX show command error as status message
-
-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)