# HG changeset patch
# User Antonio Muci <
a....@inwind.it>
# Date 1726863202 -7200
# Fri Sep 20 22:13:22 2024 +0200
# Branch stable
# Node ID 7804ef571513e1957100898a0f9f32cfa470328c
# Parent 1f17abd911a232e537b7b1c1982f7a43b4d2f025
csinfo: fix crash when stripping commits
This commit fixes a bug introduced in a015c03d91c6 ("cslist: fix
[signature-mismatch] issues overriding QWidget.update()"), which modified
cslit.ChangesetList. Invoking "Modify History | Strip" would result in a crash.
Discussion at
https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5991
diff --git a/tortoisehg/hgqt/csinfo.py b/tortoisehg/hgqt/csinfo.py
--- a/tortoisehg/hgqt/csinfo.py
+++ b/tortoisehg/hgqt/csinfo.py
@@ -9,6 +9,7 @@ from __future__ import annotations
import binascii
import re
+import sys
from .qtcore import (
QSize,
@@ -435,7 +436,21 @@ class SummaryPanel(SummaryBase, QWidget)
self.revlabel = None
self.expand_btn = qtlib.PMButton()
- def update(self, target=None, style=None, custom=None, repo=None):
+ # TODO: drop this when all callers are removed, since it hides update() in
+ # the superclass, which seems related to painting the component, or an area
+ # of it.
+ def update(self, target=None, style=None, custom=None, repo=None): # pytype: disable=signature-mismatch
+ import warnings
+
+ warnings.warn(
+ "SummaryPanel.update() should be changed to SummaryPanel.updateItems()",
+ DeprecationWarning,
+ 2,
+ )
+ sys.stderr.flush()
+ self.updateItems(target, style, custom, repo)
+
+ def updateItems(self, target=None, style=None, custom=None, repo=None):
SummaryBase.update(self, target, custom, repo)
layout = self.layout()