11 |
11 |
12 import os |
12 import os |
13 |
13 |
14 import pysvn |
14 import pysvn |
15 |
15 |
16 from PyQt5.QtCore import pyqtSlot, QMutexLocker, Qt |
16 from PyQt5.QtCore import pyqtSlot, Qt |
17 from PyQt5.QtWidgets import ( |
17 from PyQt5.QtWidgets import ( |
18 QWidget, QHeaderView, QApplication, QDialogButtonBox, QTreeWidgetItem |
18 QWidget, QHeaderView, QApplication, QDialogButtonBox, QTreeWidgetItem |
19 ) |
19 ) |
|
20 |
|
21 from E5Utilities.E5MutexLocker import E5MutexLocker |
20 |
22 |
21 from .SvnDialogMixin import SvnDialogMixin |
23 from .SvnDialogMixin import SvnDialogMixin |
22 from .Ui_SvnPropListDialog import Ui_SvnPropListDialog |
24 from .Ui_SvnPropListDialog import Ui_SvnPropListDialog |
23 |
25 |
24 |
26 |
108 dname, fnames = self.vcs.splitPathList(fn) |
110 dname, fnames = self.vcs.splitPathList(fn) |
109 else: |
111 else: |
110 dname, fname = self.vcs.splitPath(fn) |
112 dname, fname = self.vcs.splitPath(fn) |
111 fnames = [fname] |
113 fnames = [fname] |
112 |
114 |
113 locker = QMutexLocker(self.vcs.vcsExecutionMutex) |
|
114 cwd = os.getcwd() |
115 cwd = os.getcwd() |
115 os.chdir(dname) |
116 os.chdir(dname) |
116 try: |
117 with E5MutexLocker(self.vcs.vcsExecutionMutex): |
117 for name in fnames: |
118 try: |
118 proplist = self.client.proplist(name, recurse=recursive) |
119 for name in fnames: |
119 counter = 0 |
120 proplist = self.client.proplist(name, recurse=recursive) |
120 for path, prop in proplist: |
121 counter = 0 |
121 for propName, propVal in list(prop.items()): |
122 for path, prop in proplist: |
122 self.__generateItem(path, propName, propVal) |
123 for propName, propVal in list(prop.items()): |
123 self.propsFound = True |
124 self.__generateItem(path, propName, propVal) |
124 counter += 1 |
125 self.propsFound = True |
125 if counter == 30: |
126 counter += 1 |
126 # check for cancel every 30 items |
127 if counter == 30: |
127 counter = 0 |
128 # check for cancel every 30 items |
128 if self._clientCancelCallback(): |
129 counter = 0 |
129 break |
130 if self._clientCancelCallback(): |
130 if self._clientCancelCallback(): |
131 break |
131 break |
132 if self._clientCancelCallback(): |
132 except pysvn.ClientError as e: |
133 break |
133 self.__showError(e.args[0]) |
134 except pysvn.ClientError as e: |
134 locker.unlock() |
135 self.__showError(e.args[0]) |
|
136 |
135 self.__finish() |
137 self.__finish() |
136 os.chdir(cwd) |
138 os.chdir(cwd) |
137 |
139 |
138 def __finish(self): |
140 def __finish(self): |
139 """ |
141 """ |