# HG changeset patch
# User muxator <
a....@inwind.it>
# Date 1728023213 -7200
# Fri Oct 04 08:26:53 2024 +0200
# Branch stable
# Node ID e7b8ae80e35687186a550e2382ffff11c07c82a6
# 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.
Discussions:
- with Matt at
https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5991
- with Yuya at
https://groups.google.com/g/thg-dev/c/HNuN_tuuVGo
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,
@@ -106,7 +107,7 @@ class Factory(object):
else:
widget = SummaryLabel(*args)
if self.withupdate:
- widget.update()
+ widget.updateItems()
return widget
class UnknownItem(Exception):
@@ -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()
@@ -516,7 +531,21 @@ class SummaryLabel(SummaryBase, QLabel):
self.csstyle = style
- 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(
+ "SummaryLabel.update() should be changed to SummaryLabel.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)
if style is not None: