Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2791
a9577f248f04
parent 3009
bf5ae5d7477d
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
43 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 43 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
44 44
45 self.process = None 45 self.process = None
46 self.vcs = vcs 46 self.vcs = vcs
47 47
48 self.rx_status = \ 48 self.rx_status = QRegExp(
49 QRegExp('(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') 49 '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*')
50 # flags (8 or 9 anything), revision, changed rev, author, path 50 # flags (8 or 9 anything), revision, changed rev, author, path
51 self.rx_status2 = \ 51 self.rx_status2 = \
52 QRegExp('(.{8,9})\\s+(.+)\\s*') 52 QRegExp('(.{8,9})\\s+(.+)\\s*')
53 # flags (8 or 9 anything), path 53 # flags (8 or 9 anything), path
54 self.rx_changelist = \ 54 self.rx_changelist = \
66 """ 66 """
67 self.filesList.clear() 67 self.filesList.clear()
68 if current is not None: 68 if current is not None:
69 changelist = current.text() 69 changelist = current.text()
70 if changelist in self.changeListsDict: 70 if changelist in self.changeListsDict:
71 self.filesList.addItems(sorted(self.changeListsDict[changelist])) 71 self.filesList.addItems(
72 sorted(self.changeListsDict[changelist]))
72 73
73 def start(self, path): 74 def start(self, path):
74 """ 75 """
75 Public slot to populate the data. 76 Public slot to populate the data.
76 77
77 @param path directory name to show change lists for (string) 78 @param path directory name to show change lists for (string)
78 """ 79 """
79 self.changeListsDict = {} 80 self.changeListsDict = {}
80 81
81 self.filesLabel.setText(self.trUtf8("Files (relative to {0}):").format(path)) 82 self.filesLabel.setText(
83 self.trUtf8("Files (relative to {0}):").format(path))
82 84
83 self.errorGroup.hide() 85 self.errorGroup.hide()
84 self.intercept = False 86 self.intercept = False
85 87
86 self.path = path 88 self.path = path
140 self.inputGroup.setEnabled(False) 142 self.inputGroup.setEnabled(False)
141 self.inputGroup.hide() 143 self.inputGroup.hide()
142 144
143 if len(self.changeListsDict) == 0: 145 if len(self.changeListsDict) == 0:
144 self.changeLists.addItem(self.trUtf8("No changelists found")) 146 self.changeLists.addItem(self.trUtf8("No changelists found"))
145 self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) 147 self.buttonBox.button(QDialogButtonBox.Close).setFocus(
148 Qt.OtherFocusReason)
146 else: 149 else:
147 self.changeLists.addItems(sorted(self.changeListsDict.keys())) 150 self.changeLists.addItems(sorted(self.changeListsDict.keys()))
148 self.changeLists.setCurrentRow(0) 151 self.changeLists.setCurrentRow(0)
149 self.changeLists.setFocus(Qt.OtherFocusReason) 152 self.changeLists.setFocus(Qt.OtherFocusReason)
150 153
180 183
181 while self.process.canReadLine(): 184 while self.process.canReadLine():
182 s = str(self.process.readLine(), 185 s = str(self.process.readLine(),
183 Preferences.getSystem("IOEncoding"), 186 Preferences.getSystem("IOEncoding"),
184 'replace') 187 'replace')
185 if self.currentChangelist != "" and self.rx_status.exactMatch(s): 188 if self.currentChangelist != "" and \
189 self.rx_status.exactMatch(s):
186 file = self.rx_status.cap(5).strip() 190 file = self.rx_status.cap(5).strip()
187 filename = file.replace(self.path + os.sep, "") 191 filename = file.replace(self.path + os.sep, "")
188 if filename not in self.changeListsDict[self.currentChangelist]: 192 if filename not in \
189 self.changeListsDict[self.currentChangelist].append(filename) 193 self.changeListsDict[self.currentChangelist]:
190 elif self.currentChangelist != "" and self.rx_status2.exactMatch(s): 194 self.changeListsDict[self.currentChangelist].append(
195 filename)
196 elif self.currentChangelist != "" and \
197 self.rx_status2.exactMatch(s):
191 file = self.rx_status2.cap(2).strip() 198 file = self.rx_status2.cap(2).strip()
192 filename = file.replace(self.path + os.sep, "") 199 filename = file.replace(self.path + os.sep, "")
193 if filename not in self.changeListsDict[self.currentChangelist]: 200 if filename not in \
194 self.changeListsDict[self.currentChangelist].append(filename) 201 self.changeListsDict[self.currentChangelist]:
202 self.changeListsDict[self.currentChangelist].append(
203 filename)
195 elif self.rx_changelist.exactMatch(s): 204 elif self.rx_changelist.exactMatch(s):
196 self.currentChangelist = self.rx_changelist.cap(1) 205 self.currentChangelist = self.rx_changelist.cap(1)
197 if self.currentChangelist not in self.changeListsDict: 206 if self.currentChangelist not in self.changeListsDict:
198 self.changeListsDict[self.currentChangelist] = [] 207 self.changeListsDict[self.currentChangelist] = []
199 208

eric ide

mercurial