10 |
10 |
11 import os |
11 import os |
12 |
12 |
13 import pysvn |
13 import pysvn |
14 |
14 |
15 from PyQt5.QtCore import QMutexLocker, QDate, QRegExp, Qt, pyqtSlot, QPoint |
15 from PyQt5.QtCore import Qt, QDate, QRegExp, pyqtSlot, QPoint |
16 from PyQt5.QtWidgets import ( |
16 from PyQt5.QtWidgets import ( |
17 QHeaderView, QWidget, QApplication, QDialogButtonBox, QTreeWidgetItem |
17 QHeaderView, QWidget, QApplication, QDialogButtonBox, QTreeWidgetItem |
18 ) |
18 ) |
19 |
19 |
20 from E5Gui import E5MessageBox |
20 from E5Gui import E5MessageBox |
21 from E5Gui.E5OverrideCursor import E5OverrideCursor |
21 from E5Gui.E5OverrideCursor import E5OverrideCursor |
|
22 |
|
23 from E5Utilities.E5MutexLocker import E5MutexLocker |
22 |
24 |
23 from .SvnUtilities import formatTime, dateFromTime_t |
25 from .SvnUtilities import formatTime, dateFromTime_t |
24 from .SvnDialogMixin import SvnDialogMixin |
26 from .SvnDialogMixin import SvnDialogMixin |
25 |
27 |
26 from .Ui_SvnLogBrowserDialog import Ui_SvnLogBrowserDialog |
28 from .Ui_SvnLogBrowserDialog import Ui_SvnLogBrowserDialog |
273 int(startRev)) |
275 int(startRev)) |
274 except TypeError: |
276 except TypeError: |
275 start = pysvn.Revision(pysvn.opt_revision_kind.head) |
277 start = pysvn.Revision(pysvn.opt_revision_kind.head) |
276 |
278 |
277 with E5OverrideCursor(): |
279 with E5OverrideCursor(): |
278 locker = QMutexLocker(self.vcs.vcsExecutionMutex) |
|
279 cwd = os.getcwd() |
280 cwd = os.getcwd() |
280 os.chdir(self.dname) |
281 os.chdir(self.dname) |
281 try: |
282 try: |
282 nextRev = 0 |
283 nextRev = 0 |
283 fetched = 0 |
284 fetched = 0 |
284 logs = [] |
285 logs = [] |
285 while fetched < limit: |
286 with E5MutexLocker(self.vcs.vcsExecutionMutex): |
286 flimit = min(fetchLimit, limit - fetched) |
287 while fetched < limit: |
287 if fetched == 0: |
288 flimit = min(fetchLimit, limit - fetched) |
288 revstart = start |
289 if fetched == 0: |
289 else: |
290 revstart = start |
290 revstart = pysvn.Revision( |
291 else: |
291 pysvn.opt_revision_kind.number, nextRev) |
292 revstart = pysvn.Revision( |
292 allLogs = self.client.log( |
293 pysvn.opt_revision_kind.number, nextRev) |
293 self.fname, revision_start=revstart, |
294 allLogs = self.client.log( |
294 discover_changed_paths=True, limit=flimit + 1, |
295 self.fname, revision_start=revstart, |
295 strict_node_history=self.stopCheckBox.isChecked()) |
296 discover_changed_paths=True, limit=flimit + 1, |
296 if len(allLogs) <= flimit or self._clientCancelCallback(): |
297 strict_node_history=self.stopCheckBox.isChecked()) |
297 logs.extend(allLogs) |
298 if ( |
298 break |
299 len(allLogs) <= flimit or |
299 else: |
300 self._clientCancelCallback() |
300 logs.extend(allLogs[:-1]) |
301 ): |
301 nextRev = allLogs[-1]["revision"].number |
302 logs.extend(allLogs) |
302 fetched += fetchLimit |
303 break |
303 locker.unlock() |
304 else: |
|
305 logs.extend(allLogs[:-1]) |
|
306 nextRev = allLogs[-1]["revision"].number |
|
307 fetched += fetchLimit |
304 |
308 |
305 for log in logs: |
309 for log in logs: |
306 author = log["author"] |
310 author = log["author"] |
307 message = log["message"] |
311 message = log["message"] |
308 self.__generateLogItem( |
312 self.__generateLogItem( |