37 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
37 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
38 |
38 |
39 self.process = None |
39 self.process = None |
40 self.vcs = vcs |
40 self.vcs = vcs |
41 |
41 |
42 self.rx_status = \ |
42 self.rx_status = QRegExp( |
43 QRegExp('(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') |
43 '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') |
44 # flags (8 or 9 anything), revision, changed rev, author, path |
44 # flags (8 or 9 anything), revision, changed rev, author, path |
45 self.rx_status2 = \ |
45 self.rx_status2 = \ |
46 QRegExp('(.{8,9})\\s+(.+)\\s*') |
46 QRegExp('(.{8,9})\\s+(.+)\\s*') |
47 # flags (8 or 9 anything), path |
47 # flags (8 or 9 anything), path |
48 self.rx_changelist = \ |
48 self.rx_changelist = \ |
60 """ |
60 """ |
61 self.filesList.clear() |
61 self.filesList.clear() |
62 if current is not None: |
62 if current is not None: |
63 changelist = current.text() |
63 changelist = current.text() |
64 if changelist in self.changeListsDict: |
64 if changelist in self.changeListsDict: |
65 self.filesList.addItems(sorted(self.changeListsDict[changelist])) |
65 self.filesList.addItems( |
|
66 sorted(self.changeListsDict[changelist])) |
66 |
67 |
67 def start(self, path): |
68 def start(self, path): |
68 """ |
69 """ |
69 Public slot to populate the data. |
70 Public slot to populate the data. |
70 |
71 |
71 @param path directory name to show change lists for (string) |
72 @param path directory name to show change lists for (string) |
72 """ |
73 """ |
73 self.changeListsDict = {} |
74 self.changeListsDict = {} |
74 |
75 |
75 self.filesLabel.setText(self.trUtf8("Files (relative to {0}):").format(path)) |
76 self.filesLabel.setText( |
|
77 self.trUtf8("Files (relative to {0}):").format(path)) |
76 |
78 |
77 self.errorGroup.hide() |
79 self.errorGroup.hide() |
78 self.intercept = False |
80 self.intercept = False |
79 |
81 |
80 self.path = path |
82 self.path = path |
134 self.inputGroup.setEnabled(False) |
136 self.inputGroup.setEnabled(False) |
135 self.inputGroup.hide() |
137 self.inputGroup.hide() |
136 |
138 |
137 if len(self.changeListsDict) == 0: |
139 if len(self.changeListsDict) == 0: |
138 self.changeLists.addItem(self.trUtf8("No changelists found")) |
140 self.changeLists.addItem(self.trUtf8("No changelists found")) |
139 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) |
141 self.buttonBox.button(QDialogButtonBox.Close).setFocus( |
|
142 Qt.OtherFocusReason) |
140 else: |
143 else: |
141 self.changeLists.addItems(sorted(self.changeListsDict.keys())) |
144 self.changeLists.addItems(sorted(self.changeListsDict.keys())) |
142 self.changeLists.setCurrentRow(0) |
145 self.changeLists.setCurrentRow(0) |
143 self.changeLists.setFocus(Qt.OtherFocusReason) |
146 self.changeLists.setFocus(Qt.OtherFocusReason) |
144 |
147 |
174 |
177 |
175 while self.process.canReadLine(): |
178 while self.process.canReadLine(): |
176 s = str(self.process.readLine(), |
179 s = str(self.process.readLine(), |
177 Preferences.getSystem("IOEncoding"), |
180 Preferences.getSystem("IOEncoding"), |
178 'replace') |
181 'replace') |
179 if self.currentChangelist != "" and self.rx_status.exactMatch(s): |
182 if self.currentChangelist != "" and \ |
|
183 self.rx_status.exactMatch(s): |
180 file = self.rx_status.cap(5).strip() |
184 file = self.rx_status.cap(5).strip() |
181 filename = file.replace(self.path + os.sep, "") |
185 filename = file.replace(self.path + os.sep, "") |
182 if filename not in self.changeListsDict[self.currentChangelist]: |
186 if filename not in \ |
183 self.changeListsDict[self.currentChangelist].append(filename) |
187 self.changeListsDict[self.currentChangelist]: |
184 elif self.currentChangelist != "" and self.rx_status2.exactMatch(s): |
188 self.changeListsDict[self.currentChangelist].append( |
|
189 filename) |
|
190 elif self.currentChangelist != "" and \ |
|
191 self.rx_status2.exactMatch(s): |
185 file = self.rx_status2.cap(2).strip() |
192 file = self.rx_status2.cap(2).strip() |
186 filename = file.replace(self.path + os.sep, "") |
193 filename = file.replace(self.path + os.sep, "") |
187 if filename not in self.changeListsDict[self.currentChangelist]: |
194 if filename not in \ |
188 self.changeListsDict[self.currentChangelist].append(filename) |
195 self.changeListsDict[self.currentChangelist]: |
|
196 self.changeListsDict[self.currentChangelist].append( |
|
197 filename) |
189 elif self.rx_changelist.exactMatch(s): |
198 elif self.rx_changelist.exactMatch(s): |
190 self.currentChangelist = self.rx_changelist.cap(1) |
199 self.currentChangelist = self.rx_changelist.cap(1) |
191 if self.currentChangelist not in self.changeListsDict: |
200 if self.currentChangelist not in self.changeListsDict: |
192 self.changeListsDict[self.currentChangelist] = [] |
201 self.changeListsDict[self.currentChangelist] = [] |
193 |
202 |