10 import os |
10 import os |
11 |
11 |
12 import pysvn |
12 import pysvn |
13 |
13 |
14 from PyQt4.QtCore import pyqtSlot, Qt, QMutexLocker |
14 from PyQt4.QtCore import pyqtSlot, Qt, QMutexLocker |
15 from PyQt4.QtGui import QDialog, QDialogButtonBox, QListWidgetItem, QApplication, \ |
15 from PyQt4.QtGui import QDialog, QDialogButtonBox, QListWidgetItem, \ |
16 QCursor |
16 QApplication, QCursor |
17 |
17 |
18 from .SvnDialogMixin import SvnDialogMixin |
18 from .SvnDialogMixin import SvnDialogMixin |
19 |
19 |
20 from .Ui_SvnChangeListsDialog import Ui_SvnChangeListsDialog |
20 from .Ui_SvnChangeListsDialog import Ui_SvnChangeListsDialog |
21 |
21 |
58 """ |
58 """ |
59 self.filesList.clear() |
59 self.filesList.clear() |
60 if current is not None: |
60 if current is not None: |
61 changelist = current.text() |
61 changelist = current.text() |
62 if changelist in self.changeListsDict: |
62 if changelist in self.changeListsDict: |
63 self.filesList.addItems(sorted(self.changeListsDict[changelist])) |
63 self.filesList.addItems( |
|
64 sorted(self.changeListsDict[changelist])) |
64 |
65 |
65 def start(self, path): |
66 def start(self, path): |
66 """ |
67 """ |
67 Public slot to populate the data. |
68 Public slot to populate the data. |
68 |
69 |
69 @param path directory name to show change lists for (string) |
70 @param path directory name to show change lists for (string) |
70 """ |
71 """ |
71 self.changeListsDict = {} |
72 self.changeListsDict = {} |
72 self.cancelled = False |
73 self.cancelled = False |
73 |
74 |
74 self.filesLabel.setText(self.trUtf8("Files (relative to {0}):").format(path)) |
75 self.filesLabel.setText( |
|
76 self.trUtf8("Files (relative to {0}):").format(path)) |
75 |
77 |
76 QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) |
78 QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) |
77 QApplication.processEvents() |
79 QApplication.processEvents() |
78 |
80 |
79 locker = QMutexLocker(self.vcs.vcsExecutionMutex) |
81 locker = QMutexLocker(self.vcs.vcsExecutionMutex) |
80 try: |
82 try: |
81 entries = self.client.get_changelist(path, depth=pysvn.depth.infinity) |
83 entries = self.client.get_changelist( |
|
84 path, depth=pysvn.depth.infinity) |
82 for entry in entries: |
85 for entry in entries: |
83 file = entry[0] |
86 file = entry[0] |
84 changelist = entry[1] |
87 changelist = entry[1] |
85 if changelist not in self.changeListsDict: |
88 if changelist not in self.changeListsDict: |
86 self.changeListsDict[changelist] = [] |
89 self.changeListsDict[changelist] = [] |
103 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
106 self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) |
104 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
107 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) |
105 |
108 |
106 if len(self.changeListsDict) == 0: |
109 if len(self.changeListsDict) == 0: |
107 self.changeLists.addItem(self.trUtf8("No changelists found")) |
110 self.changeLists.addItem(self.trUtf8("No changelists found")) |
108 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) |
111 self.buttonBox.button(QDialogButtonBox.Close).setFocus( |
|
112 Qt.OtherFocusReason) |
109 else: |
113 else: |
110 self.changeLists.setCurrentRow(0) |
114 self.changeLists.setCurrentRow(0) |
111 self.changeLists.setFocus(Qt.OtherFocusReason) |
115 self.changeLists.setFocus(Qt.OtherFocusReason) |
112 |
116 |
113 def on_buttonBox_clicked(self, button): |
117 def on_buttonBox_clicked(self, button): |