Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3009
bf5ae5d7477d
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
12 import os 12 import os
13 13
14 import pysvn 14 import pysvn
15 15
16 from PyQt4.QtCore import QMutexLocker, Qt 16 from PyQt4.QtCore import QMutexLocker, Qt
17 from PyQt4.QtGui import QHeaderView, QDialog, QDialogButtonBox, QFont, QTreeWidgetItem 17 from PyQt4.QtGui import QHeaderView, QDialog, QDialogButtonBox, QFont, \
18 QTreeWidgetItem
18 19
19 from .SvnDialogMixin import SvnDialogMixin 20 from .SvnDialogMixin import SvnDialogMixin
20 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog 21 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog
21 22
22 import Utilities 23 import Utilities
74 os.chdir(dname) 75 os.chdir(dname)
75 try: 76 try:
76 annotations = self.client.annotate(fname) 77 annotations = self.client.annotate(fname)
77 locker.unlock() 78 locker.unlock()
78 for annotation in annotations: 79 for annotation in annotations:
79 self.__generateItem(annotation["revision"].number, 80 self.__generateItem(
80 annotation["author"], annotation["number"] + 1, annotation["line"]) 81 annotation["revision"].number, annotation["author"],
82 annotation["number"] + 1, annotation["line"])
81 except pysvn.ClientError as e: 83 except pysvn.ClientError as e:
82 locker.unlock() 84 locker.unlock()
83 self.__showError(e.args[0] + '\n') 85 self.__showError(e.args[0] + '\n')
84 self.__finish() 86 self.__finish()
85 os.chdir(cwd) 87 os.chdir(cwd)
86 88
87 def __finish(self): 89 def __finish(self):
88 """ 90 """
89 Private slot called when the process finished or the user pressed the button. 91 Private slot called when the process finished or the user pressed the
92 button.
90 """ 93 """
91 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) 94 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
92 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) 95 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
93 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) 96 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
94 97

eric ide

mercurial