Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py

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

eric ide

mercurial