Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py

changeset 212
19785b4c1bed
parent 211
4da68bd1a703
child 213
42bb97ff0bbb
equal deleted inserted replaced
211:4da68bd1a703 212:19785b4c1bed
213 self.errors.append(self.trUtf8("No log available for '{0}'")\ 213 self.errors.append(self.trUtf8("No log available for '{0}'")\
214 .format(self.filename)) 214 .format(self.filename))
215 self.errorGroup.show() 215 self.errorGroup.show()
216 return 216 return
217 217
218 html = ""
219
218 if self.initialText: 220 if self.initialText:
219 for line in self.initialText: 221 for line in self.initialText:
220 self.contents.insertHtml(Utilities.html_encode(line.strip())) 222 html += Utilities.html_encode(line.strip())
221 self.contents.insertHtml('<br />\n') 223 html += '<br />\n'
222 self.contents.insertHtml('{0}<br/>\n'.format(80 * "=")) 224 html += '{0}<br/>\n'.format(80 * "=")
223 225
224 for entry in self.logEntries: 226 for entry in self.logEntries:
225 fileCopies = {} 227 fileCopies = {}
226 if entry["file_copies"]: 228 if entry["file_copies"]:
227 for fentry in entry["file_copies"].split(", "): 229 for fentry in entry["file_copies"].split(", "):
245 url.toString(), 247 url.toString(),
246 str(query, encoding="ascii"), 248 str(query, encoding="ascii"),
247 self.trUtf8('diff to {0}').format(parent), 249 self.trUtf8('diff to {0}').format(parent),
248 ) 250 )
249 dstr += '<br />\n' 251 dstr += '<br />\n'
250 self.contents.insertHtml(dstr) 252 html += dstr
251 253
252 self.contents.insertHtml(self.trUtf8("Branches: {0}<br />\n")\ 254 html += self.trUtf8("Branches: {0}<br />\n").format(entry["branches"])
253 .format(entry["branches"])) 255
254 256 html += self.trUtf8("Tags: {0}<br />\n").format(entry["tags"])
255 self.contents.insertHtml(self.trUtf8("Tags: {0}<br />\n")\ 257
256 .format(entry["tags"])) 258 html += self.trUtf8("Parents: {0}<br />\n").format(entry["parents"])
257 259
258 self.contents.insertHtml(self.trUtf8("Parents: {0}<br />\n")\ 260 html += self.trUtf8('<i>Author: {0}</i><br />\n').format(entry["user"])
259 .format(entry["parents"]))
260
261 self.contents.insertHtml(self.trUtf8('<i>Author: {0}</i><br />\n')\
262 .format(entry["user"]))
263 261
264 date, time = entry["date"].split()[:2] 262 date, time = entry["date"].split()[:2]
265 self.contents.insertHtml(self.trUtf8('<i>Date: {0}, {1}</i><br />\n')\ 263 html += self.trUtf8('<i>Date: {0}, {1}</i><br />\n').format(date, time)
266 .format(date, time))
267 264
268 for line in entry["description"]: 265 for line in entry["description"]:
269 self.contents.insertHtml(Utilities.html_encode(line.strip())) 266 html += Utilities.html_encode(line.strip())
270 self.contents.insertHtml('<br />\n') 267 html += '<br />\n'
271 268
272 if entry["file_adds"]: 269 if entry["file_adds"]:
273 self.contents.insertHtml('<br />\n') 270 html += '<br />\n'
274 for f in entry["file_adds"].strip().split(", "): 271 for f in entry["file_adds"].strip().split(", "):
275 if f in fileCopies: 272 if f in fileCopies:
276 self.contents.insertHtml( 273 html += self.trUtf8('Added {0} (copied from {1})<br />\n')\
277 self.trUtf8('Added {0} (copied from {1})<br />\n')\
278 .format(Utilities.html_encode(f), 274 .format(Utilities.html_encode(f),
279 Utilities.html_encode(fileCopies[f]))) 275 Utilities.html_encode(fileCopies[f]))
280 else: 276 else:
281 self.contents.insertHtml( 277 html += self.trUtf8('Added {0}<br />\n')\
282 self.trUtf8('Added {0}<br />\n')\ 278 .format(Utilities.html_encode(f))
283 .format(Utilities.html_encode(f)))
284 279
285 if entry["files_mods"]: 280 if entry["files_mods"]:
286 self.contents.insertHtml('<br />\n') 281 html += '<br />\n'
287 for f in entry["files_mods"].strip().split(", "): 282 for f in entry["files_mods"].strip().split(", "):
288 self.contents.insertHtml( 283 html += self.trUtf8('Modified {0}<br />\n')\
289 self.trUtf8('Modified {0}<br />\n')\ 284 .format(Utilities.html_encode(f))
290 .format(Utilities.html_encode(f)))
291 285
292 if entry["file_dels"]: 286 if entry["file_dels"]:
293 self.contents.insertHtml('<br />\n') 287 html += '<br />\n'
294 for f in entry["file_dels"].strip().split(", "): 288 for f in entry["file_dels"].strip().split(", "):
295 self.contents.insertHtml( 289 html += self.trUtf8('Deleted {0}<br />\n')\
296 self.trUtf8('Deleted {0}<br />\n')\ 290 .format(Utilities.html_encode(f))
297 .format(Utilities.html_encode(f))) 291
298 292 html += '</p>{0}<br/>\n'.format(80 * "=")
299 self.contents.insertHtml('</p>{0}<br/>\n'.format(80 * "=")) 293
300 294 self.contents.setHtml(html)
301 tc = self.contents.textCursor() 295 tc = self.contents.textCursor()
302 tc.movePosition(QTextCursor.Start) 296 tc.movePosition(QTextCursor.Start)
303 self.contents.setTextCursor(tc) 297 self.contents.setTextCursor(tc)
304 self.contents.ensureCursorVisible() 298 self.contents.ensureCursorVisible()
305 299

eric ide

mercurial