Fixed an issue in the Mercurial annotate dialog causing user names with spaces to not being shown correctly. 5_4_x

Wed, 02 Apr 2014 19:08:31 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 02 Apr 2014 19:08:31 +0200
branch
5_4_x
changeset 3470
741ab2eecaf9
parent 3467
2bf0226c7501
child 3474
ca4b926f1bbb

Fixed an issue in the Mercurial annotate dialog causing user names with spaces to not being shown correctly.
(grafted from 53a53c45a3f0bd47fbe53b8cdcf68394384d8cb1)

Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py	Wed Apr 02 19:01:16 2014 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py	Wed Apr 02 19:08:31 2014 +0200
@@ -8,6 +8,7 @@
 """
 
 import os
+import re
 
 from PyQt4.QtCore import pyqtSlot, QProcess, QTimer, Qt, QCoreApplication
 from PyQt4.QtGui import QDialog, QDialogButtonBox, QFont, QHeaderView, \
@@ -41,6 +42,9 @@
         self.vcs = vcs
         self.__hgClient = vcs.getClient()
         
+        self.__annotateRe = re.compile(
+            r"""(.+)\s+(\d+)\s+([0-9a-fA-F]+)\s+([0-9-]+)\s+(.+)""")
+        
         self.annotateList.headerItem().setText(
             self.annotateList.columnCount(), "")
         font = QFont(self.annotateList.font())
@@ -240,8 +244,10 @@
         except ValueError:
             info = line[:-2]
             text = ""
-        author, rev, changeset, date, file = info.split()
-        self.__generateItem(rev, changeset, author, date, text)
+        match = self.__annotateRe.match(info)
+        author, rev, changeset, date, file = match.groups()
+        self.__generateItem(rev.strip(), changeset.strip(), author.strip(),
+                            date.strip(), text)
     
     def __readStderr(self):
         """

eric ide

mercurial