eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py

changeset 7370
5fb53279f2df
parent 7360
9190402e4505
child 7759
51aa6c6b66f7
diff -r dbeeed55df08 -r 5fb53279f2df eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py	Wed Jan 08 19:13:57 2020 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/queues.py	Mon Jan 13 19:23:08 2020 +0100
@@ -7,10 +7,8 @@
 Module implementing the queues extension interface.
 """
 
-
 import os
 
-from PyQt5.QtCore import QProcess
 from PyQt5.QtWidgets import QDialog, QApplication, QInputDialog
 
 from E5Gui import E5MessageBox
@@ -98,19 +96,7 @@
             args.append("--summary")
         
         client = self.vcs.getClient()
-        output = ""
-        if client:
-            output = client.runcommand(args)[0]
-        else:
-            process = QProcess()
-            process.setWorkingDirectory(repodir)
-            process.start('hg', args)
-            procStarted = process.waitForStarted(5000)
-            if procStarted:
-                finished = process.waitForFinished(30000)
-                if finished and process.exitCode() == 0:
-                    output = str(process.readAllStandardOutput(),
-                                 self.vcs.getEncoding(), 'replace')
+        output = client.runcommand(args)[0]
         
         for line in output.splitlines():
             if withSummary:
@@ -137,19 +123,7 @@
         args = self.vcs.initCommand("qtop")
         
         client = self.vcs.getClient()
-        if client:
-            currentPatch = client.runcommand(args)[0].strip()
-        else:
-            process = QProcess()
-            process.setWorkingDirectory(repodir)
-            process.start('hg', args)
-            procStarted = process.waitForStarted(5000)
-            if procStarted:
-                finished = process.waitForFinished(30000)
-                if finished and process.exitCode() == 0:
-                    currentPatch = str(process.readAllStandardOutput(),
-                                       self.vcs.getEncoding(),
-                                       'replace').strip()
+        currentPatch = client.runcommand(args)[0].strip()
         
         return currentPatch
     
@@ -165,18 +139,7 @@
         args = self.vcs.initCommand("qheader")
         
         client = self.vcs.getClient()
-        if client:
-            message = client.runcommand(args)[0]
-        else:
-            process = QProcess()
-            process.setWorkingDirectory(repodir)
-            process.start('hg', args)
-            procStarted = process.waitForStarted(5000)
-            if procStarted:
-                finished = process.waitForFinished(30000)
-                if finished and process.exitCode() == 0:
-                    message = str(process.readAllStandardOutput(),
-                                  self.vcs.getEncoding(), 'replace')
+        message = client.runcommand(args)[0]
         
         return message
     
@@ -195,19 +158,7 @@
             args.append("--series")
         
         client = self.vcs.getClient()
-        output = ""
-        if client:
-            output = client.runcommand(args)[0]
-        else:
-            process = QProcess()
-            process.setWorkingDirectory(repodir)
-            process.start('hg', args)
-            procStarted = process.waitForStarted(5000)
-            if procStarted:
-                finished = process.waitForFinished(30000)
-                if finished and process.exitCode() == 0:
-                    output = str(process.readAllStandardOutput(),
-                                 self.vcs.getEncoding(), 'replace')
+        output = client.runcommand(args)[0]
         
         for guard in output.splitlines():
             guard = guard.strip()
@@ -646,15 +597,7 @@
                 args.append("--none")
                 
                 client = self.vcs.getClient()
-                if client:
-                    client.runcommand(args)
-                else:
-                    process = QProcess()
-                    process.setWorkingDirectory(repodir)
-                    process.start('hg', args)
-                    procStarted = process.waitForStarted(5000)
-                    if procStarted:
-                        process.waitForFinished(30000)
+                client.runcommand(args)
         else:
             E5MessageBox.information(
                 None,
@@ -776,20 +719,7 @@
                 args.append(queueName)
                 
                 client = self.vcs.getClient()
-                error = ""
-                if client:
-                    error = client.runcommand(args)[1]
-                else:
-                    process = QProcess()
-                    process.setWorkingDirectory(repodir)
-                    process.start('hg', args)
-                    procStarted = process.waitForStarted(5000)
-                    if procStarted:
-                        finished = process.waitForFinished(30000)
-                        if finished:
-                            if process.exitCode() != 0:
-                                error = str(process.readAllStandardError(),
-                                            self.vcs.getEncoding(), 'replace')
+                error = client.runcommand(args)[1]
                 
                 if error:
                     if isCreate:
@@ -852,20 +782,7 @@
                 args.append(queueName)
                 
                 client = self.vcs.getClient()
-                error = ""
-                if client:
-                    error = client.runcommand(args)[1]
-                else:
-                    process = QProcess()
-                    process.setWorkingDirectory(repodir)
-                    process.start('hg', args)
-                    procStarted = process.waitForStarted(5000)
-                    if procStarted:
-                        finished = process.waitForFinished(30000)
-                        if finished:
-                            if process.exitCode() != 0:
-                                error = str(process.readAllStandardError(),
-                                            self.vcs.getEncoding(), 'replace')
+                error = client.runcommand(args)[1]
                 
                 if error:
                     if operation == Queues.QUEUE_PURGE:

eric ide

mercurial