Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py

changeset 3469
53a53c45a3f0
parent 3302
e92f0dd51979
child 3515
1b8381afe38f
--- a/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py	Wed Apr 02 18:58:09 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, QHeaderView, QLineEdit, \
@@ -40,6 +41,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 = Preferences.getEditorOtherFonts("MonospacedFont")
@@ -232,8 +236,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