Fixed a little issue in the Subversion plug-in detecting additions and deletions in the update operation.

Sat, 30 Jun 2012 14:17:27 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 30 Jun 2012 14:17:27 +0200
changeset 1919
86ba302d02b2
parent 1918
f1bc2b9f4402
child 1920
b62a576ca380

Fixed a little issue in the Subversion plug-in detecting additions and deletions in the update operation.

Plugins/VcsPlugins/vcsSubversion/SvnDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/subversion.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsSubversion/SvnDialog.py	Thu Jun 28 19:04:16 2012 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnDialog.py	Sat Jun 30 14:17:27 2012 +0200
@@ -9,7 +9,7 @@
 
 import os
 
-from PyQt4.QtCore import QTimer, QProcess, pyqtSlot, Qt
+from PyQt4.QtCore import QTimer, QProcess, pyqtSlot, Qt, QProcessEnvironment
 from PyQt4.QtGui import QLineEdit, QDialog, QDialogButtonBox
 
 from E5Gui import E5MessageBox
@@ -96,12 +96,13 @@
         self.normal = (exitStatus == QProcess.NormalExit) and (exitCode == 0)
         self.__finish()
         
-    def startProcess(self, args, workingDir=None):
+    def startProcess(self, args, workingDir=None, setLanguage=False):
         """
         Public slot used to start the process.
         
         @param args list of arguments for the process (list of strings)
         @param workingDir working directory for the process (string)
+        @param setLanguage flag indicating to set the language to "C" (boolean)
         @return flag indicating a successful start of the process
         """
         self.errorGroup.hide()
@@ -111,6 +112,10 @@
         self.__hasAddOrDelete = False
         
         self.proc = QProcess()
+        if setLanguage:
+            env = QProcessEnvironment.systemEnvironment()
+            env.insert("LANG", "C")
+            self.proc.setProcessEnvironment(env)
         nargs = []
         lastWasPwd = False
         for arg in args:
@@ -175,7 +180,7 @@
                     if '.e4p' in l:
                         self.__hasAddOrDelete = True
                         break
-                    if l and l[0].strip() in ['A', 'D']:
+                    if l and l[0:2].strip() in ['A', 'D']:
                         self.__hasAddOrDelete = True
                         break
         
--- a/Plugins/VcsPlugins/vcsSubversion/subversion.py	Thu Jun 28 19:04:16 2012 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/subversion.py	Sat Jun 30 14:17:27 2012 +0200
@@ -539,7 +539,7 @@
             res = False
         else:
             dia = SvnDialog(self.trUtf8('Synchronizing with the Subversion repository'))
-            res = dia.startProcess(args, dname)
+            res = dia.startProcess(args, dname, True)
             if res:
                 dia.exec_()
                 res = dia.hasAddOrDelete()
@@ -1033,7 +1033,7 @@
         
         dia = SvnDialog(self.trUtf8('Switching to {0}')
             .format(tn))
-        res = dia.startProcess(args)
+        res = dia.startProcess(args, setLanguage=True)
         if res:
             dia.exec_()
             res = dia.hasAddOrDelete()

eric ide

mercurial