282 self.inputGroup.hide() |
282 self.inputGroup.hide() |
283 |
283 |
284 self.contents.clear() |
284 self.contents.clear() |
285 |
285 |
286 if not self.logEntries: |
286 if not self.logEntries: |
287 self.errors.append(self.trUtf8("No log available for '{0}'")\ |
287 self.errors.append(self.trUtf8("No log available for '{0}'") |
288 .format(self.filename)) |
288 .format(self.filename)) |
289 self.errorGroup.show() |
289 self.errorGroup.show() |
290 return |
290 return |
291 |
291 |
292 html = "" |
292 html = "" |
360 'Added {0} (copied from {1})<br />\n')\ |
360 'Added {0} (copied from {1})<br />\n')\ |
361 .format(Utilities.html_encode(f), |
361 .format(Utilities.html_encode(f), |
362 Utilities.html_encode(fileCopies[f])) |
362 Utilities.html_encode(fileCopies[f])) |
363 else: |
363 else: |
364 html += self.trUtf8('Added {0}<br />\n')\ |
364 html += self.trUtf8('Added {0}<br />\n')\ |
365 .format(Utilities.html_encode(f)) |
365 .format(Utilities.html_encode(f)) |
366 |
366 |
367 if entry["files_mods"]: |
367 if entry["files_mods"]: |
368 html += '<br />\n' |
368 html += '<br />\n' |
369 for f in entry["files_mods"].strip().split(", "): |
369 for f in entry["files_mods"].strip().split(", "): |
370 html += self.trUtf8('Modified {0}<br />\n')\ |
370 html += self.trUtf8('Modified {0}<br />\n')\ |
371 .format(Utilities.html_encode(f)) |
371 .format(Utilities.html_encode(f)) |
372 |
372 |
373 if entry["file_dels"]: |
373 if entry["file_dels"]: |
374 html += '<br />\n' |
374 html += '<br />\n' |
375 for f in entry["file_dels"].strip().split(", "): |
375 for f in entry["file_dels"].strip().split(", "): |
376 html += self.trUtf8('Deleted {0}<br />\n')\ |
376 html += self.trUtf8('Deleted {0}<br />\n')\ |
377 .format(Utilities.html_encode(f)) |
377 .format(Utilities.html_encode(f)) |
378 |
378 |
379 html += '</p>{0}<br/>\n'.format(80 * "=") |
379 html += '</p>{0}<br/>\n'.format(80 * "=") |
380 |
380 |
381 self.contents.setHtml(html) |
381 self.contents.setHtml(html) |
382 tc = self.contents.textCursor() |
382 tc = self.contents.textCursor() |
392 """ |
392 """ |
393 self.process.setReadChannel(QProcess.StandardOutput) |
393 self.process.setReadChannel(QProcess.StandardOutput) |
394 |
394 |
395 while self.process.canReadLine(): |
395 while self.process.canReadLine(): |
396 s = str(self.process.readLine(), |
396 s = str(self.process.readLine(), |
397 Preferences.getSystem("IOEncoding"), |
397 Preferences.getSystem("IOEncoding"), |
398 'replace') |
398 'replace') |
399 self.__processOutputLine(s) |
399 self.__processOutputLine(s) |
400 |
400 |
401 def __processOutputLine(self, line): |
401 def __processOutputLine(self, line): |
402 """ |
402 """ |
403 Private method to process the lines of output. |
403 Private method to process the lines of output. |
415 key = "" |
415 key = "" |
416 value = line |
416 value = line |
417 if key == "change": |
417 if key == "change": |
418 self.endInitialText = True |
418 self.endInitialText = True |
419 if key in ("change", "branches", "tags", "parents", "user", |
419 if key in ("change", "branches", "tags", "parents", "user", |
420 "date", "file_copies", "file_adds", "files_mods", |
420 "date", "file_copies", "file_adds", "files_mods", |
421 "file_dels", "bookmarks", "phase"): |
421 "file_dels", "bookmarks", "phase"): |
422 self.lastLogEntry[key] = value.strip() |
422 self.lastLogEntry[key] = value.strip() |
423 elif key == "description": |
423 elif key == "description": |
424 self.lastLogEntry[key] = [value.strip()] |
424 self.lastLogEntry[key] = [value.strip()] |
425 else: |
425 else: |
426 if self.endInitialText: |
426 if self.endInitialText: |
435 It reads the error output of the process and inserts it into the |
435 It reads the error output of the process and inserts it into the |
436 error pane. |
436 error pane. |
437 """ |
437 """ |
438 if self.process is not None: |
438 if self.process is not None: |
439 s = str(self.process.readAllStandardError(), |
439 s = str(self.process.readAllStandardError(), |
440 Preferences.getSystem("IOEncoding"), |
440 Preferences.getSystem("IOEncoding"), |
441 'replace') |
441 'replace') |
442 self.__showError(s) |
442 self.__showError(s) |
443 |
443 |
444 def __showError(self, out): |
444 def __showError(self, out): |
445 """ |
445 """ |
446 Private slot to show some error. |
446 Private slot to show some error. |