Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 3302
e92f0dd51979
parent 3287
c3d784c057b3
child 3315
bd1a25ead18d
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sun Feb 23 15:24:28 2014 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sun Feb 23 19:20:43 2014 +0100
@@ -20,7 +20,6 @@
 
 from .Ui_HgLogBrowserDialog import Ui_HgLogBrowserDialog
 
-import Preferences
 import UI.PixmapCache
 
 COLORNAMES = ["blue", "darkgreen", "red", "green", "darkblue", "purple",
@@ -437,8 +436,7 @@
         parents = [-1]
         
         if int(rev) > 0:
-            args = []
-            args.append("parents")
+            args = self.vcs.initCommand("parents")
             if self.commandMode == "incoming":
                 if self.__bundle:
                     args.append("--repository")
@@ -465,10 +463,8 @@
                 if procStarted:
                     finished = process.waitForFinished(30000)
                     if finished and process.exitCode() == 0:
-                        output = \
-                            str(process.readAllStandardOutput(),
-                                Preferences.getSystem("IOEncoding"),
-                                'replace')
+                        output = str(process.readAllStandardOutput(),
+                                     self.vcs.getEncoding(), 'replace')
                     else:
                         if not finished:
                             errMsg = self.tr(
@@ -493,8 +489,7 @@
         """
         errMsg = ""
         
-        args = []
-        args.append("identify")
+        args = self.vcs.initCommand("identify")
         args.append("-nb")
         
         output = ""
@@ -508,10 +503,8 @@
             if procStarted:
                 finished = process.waitForFinished(30000)
                 if finished and process.exitCode() == 0:
-                    output = \
-                        str(process.readAllStandardOutput(),
-                            Preferences.getSystem("IOEncoding"),
-                            'replace')
+                    output = str(process.readAllStandardOutput(),
+                                 self.vcs.getEncoding(), 'replace')
                 else:
                     if not finished:
                         errMsg = self.tr(
@@ -540,8 +533,7 @@
         self.__closedBranchesRevs = []
         errMsg = ""
         
-        args = []
-        args.append("branches")
+        args = self.vcs.initCommand("branches")
         args.append("--closed")
         
         output = ""
@@ -555,10 +547,8 @@
             if procStarted:
                 finished = process.waitForFinished(30000)
                 if finished and process.exitCode() == 0:
-                    output = \
-                        str(process.readAllStandardOutput(),
-                            Preferences.getSystem("IOEncoding"),
-                            'replace')
+                    output = str(process.readAllStandardOutput(),
+                                 self.vcs.getEncoding(), 'replace')
                 else:
                     if not finished:
                         errMsg = self.tr(
@@ -698,10 +688,7 @@
         self.intercept = False
         
         preargs = []
-        args = []
-        args.append(self.commandMode)
-        self.vcs.addArguments(args, self.vcs.options['global'])
-        self.vcs.addArguments(args, self.vcs.options['log'])
+        args = self.vcs.initCommand(self.commandMode)
         args.append('--verbose')
         if self.commandMode not in ("incoming", "outgoing"):
             args.append('--limit')
@@ -1026,8 +1013,7 @@
         self.process.setReadChannel(QProcess.StandardOutput)
         
         while self.process.canReadLine():
-            line = str(self.process.readLine(),
-                       Preferences.getSystem("IOEncoding"),
+            line = str(self.process.readLine(), self.vcs.getEncoding(),
                        'replace')
             self.buf.append(line)
     
@@ -1040,8 +1026,7 @@
         """
         if self.process is not None:
             s = str(self.process.readAllStandardError(),
-                    Preferences.getSystem("IOEncoding"),
-                    'replace')
+                    self.vcs.getEncoding(), 'replace')
             self.__showError(s)
     
     def __showError(self, out):

eric ide

mercurial