Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py

branch
Py2 comp.
changeset 3141
72f3bde98c58
parent 3058
0a02c433f52d
child 3145
a9de05d4a22f
equal deleted inserted replaced
3127:e47a9d5954e8 3141:72f3bde98c58
8 """ 8 """
9 9
10 from __future__ import unicode_literals # __IGNORE_WARNING__ 10 from __future__ import unicode_literals # __IGNORE_WARNING__
11 11
12 import os 12 import os
13 import sys
13 14
14 import pysvn 15 import pysvn
15 16
16 from PyQt4.QtCore import QMutexLocker, Qt 17 from PyQt4.QtCore import QMutexLocker, Qt
17 from PyQt4.QtGui import QHeaderView, QDialog, QDialogButtonBox, QFont, \ 18 from PyQt4.QtGui import QHeaderView, QDialog, QDialogButtonBox, QFont, \
75 os.chdir(dname) 76 os.chdir(dname)
76 try: 77 try:
77 annotations = self.client.annotate(fname) 78 annotations = self.client.annotate(fname)
78 locker.unlock() 79 locker.unlock()
79 for annotation in annotations: 80 for annotation in annotations:
81 author = annotation["author"]
82 line = annotation["line"]
83 if sys.version_info[0] == 2:
84 author = author.decode('utf-8')
85 line = line.decode('utf-8')
80 self.__generateItem( 86 self.__generateItem(
81 annotation["revision"].number, annotation["author"], 87 annotation["revision"].number, author,
82 annotation["number"] + 1, annotation["line"]) 88 annotation["number"] + 1, line)
83 except pysvn.ClientError as e: 89 except pysvn.ClientError as e:
84 locker.unlock() 90 locker.unlock()
85 self.__showError(e.args[0] + '\n') 91 self.__showError(e.args[0] + '\n')
86 self.__finish() 92 self.__finish()
87 os.chdir(cwd) 93 os.chdir(cwd)

eric ide

mercurial