Code cleanup/comments, more test coverage (92%)

This commit is contained in:
Miguel Jacq 2025-11-07 11:42:29 +11:00
parent 66950eeff5
commit 74177f2cd3
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
19 changed files with 463 additions and 22 deletions

View file

@ -156,7 +156,7 @@ class HistoryDialog(QDialog):
# Diff vs current (textual diff)
cur = self._db.get_version(version_id=self._current_id)
self.diff.setHtml(_colored_unified_diff_html(cur["content"], sel["content"]))
# Enable revert only if selecting a non-current
# Enable revert only if selecting a non-current version
self.btn_revert.setEnabled(sel_id != self._current_id)
@Slot()
@ -167,7 +167,7 @@ class HistoryDialog(QDialog):
sel_id = item.data(Qt.UserRole)
if sel_id == self._current_id:
return
# Flip head pointer
# Flip head pointer to the older version
try:
self._db.revert_to_version(self._date, version_id=sel_id)
except Exception as e: