# Date 1736888702 18000
# Tue Jan 14 16:05:02 2025 -0500
# Branch stable
# Node ID 7053741f567846319ecf088c7a4098f6bc760a7d
# Parent d79536d768756db4df65a8784a472f0a73298dae
# EXP-Topic issue-6003
csinfo: migrate several callers to the new `updateItems()` method
More whack-a-mole related to a015c03d91c6, 2dcff69f6563, d6687bcaf716, and
8aa97d83492b. I caught `commit.py`, `csinfo.py` (the second change),
`resolve.py`, `revdetails.py`, and `update.py` by running the app with
`pythonw.exe thg --nofork` instead of `python.exe thg --nofork` on Windows, and
it complained that there's no `flush()` on None in the old function that's
trying to emit a deprecation warning. No sign of the deprecation warning when
running with the latter command. The remainder were found by grepping for
`\.update\(`, excluding `tests/` and `contrib/`, and examining the 69 matches.
diff --git a/tortoisehg/hgqt/backout.py b/tortoisehg/hgqt/backout.py
--- a/tortoisehg/hgqt/backout.py
+++ b/tortoisehg/hgqt/backout.py
@@ -269,7 +269,7 @@
def repositoryChanged(self) -> None:
'repository has detected a change to changelog or parents'
pctx = self.repo[b'.']
- self.localCsInfo.update(pctx)
+ self.localCsInfo.updateItems(pctx)
def canExit(self) -> bool:
'can backout tool be closed?'
@@ -609,5 +609,5 @@
self.layout().addStretch(1)
def currentPage(self) -> None:
- self.bkCsInfo.update(self.repo[b'tip'])
+ self.bkCsInfo.updateItems(self.repo[b'tip'])
self.wizard().setOption(QWizard.WizardOption.NoCancelButton, True)
diff --git a/tortoisehg/hgqt/commit.py b/tortoisehg/hgqt/commit.py
--- a/tortoisehg/hgqt/commit.py
+++ b/tortoisehg/hgqt/commit.py
@@ -610,7 +610,7 @@
self.stwidget.refreshWctx()
custom = self.wdirinfo.custom.copy()
custom['isAmend'] = curraction._name == 'amend'
- self.wdirinfo.update(custom=custom)
+ self.wdirinfo.updateItems(custom=custom)
self.committb.setText(curraction._text)
self.lastAction = curraction._name
@@ -855,7 +855,7 @@
# Update wdir csinfo widget
self.wdirinfo.set_revision(None)
- self.wdirinfo.update()
+ self.wdirinfo.updateItems()
# This is ugly, but want pnlabel to have the same alignment/style/etc
# as wdirinfo, so extract the needed parts of wdirinfo's markup. Would
diff --git a/tortoisehg/hgqt/csinfo.py b/tortoisehg/hgqt/csinfo.py
--- a/tortoisehg/hgqt/csinfo.py
+++ b/tortoisehg/hgqt/csinfo.py
@@ -467,7 +467,7 @@
if 'expandable' in self.csstyle and self.csstyle['expandable']:
if self.expand_btn.parentWidget() is None:
- self.expand_btn.clicked.connect(lambda: self.update())
+ self.expand_btn.clicked.connect(lambda: self.updateItems())
margin = QHBoxLayout()
margin.setContentsMargins(3, 3, 3, 3)
margin.addWidget(self.expand_btn, 0, Qt.AlignmentFlag.AlignTop)
@@ -513,7 +513,7 @@
def set_expanded(self, state):
self.expand_btn.set_expanded(state)
- self.update()
+ self.updateItems()
def is_expanded(self):
return self.expand_btn.is_expanded()
diff --git a/tortoisehg/hgqt/filedialogs.py b/tortoisehg/hgqt/filedialogs.py
--- a/tortoisehg/hgqt/filedialogs.py
+++ b/tortoisehg/hgqt/filedialogs.py
@@ -389,7 +389,7 @@
self.textView.display(fd)
self.textView.verticalScrollBar().setValue(pos)
self.revpanel.set_revision(rev)
- self.revpanel.update(repo = self.repo)
+ self.revpanel.updateItems(repo = self.repo)
@pyqtSlot()
def _onRevisionSelectionChanged(self):
diff --git a/tortoisehg/hgqt/graft.py b/tortoisehg/hgqt/graft.py
--- a/tortoisehg/hgqt/graft.py
+++ b/tortoisehg/hgqt/graft.py
@@ -195,7 +195,7 @@
def _updateSource(self, idx: int) -> None:
self._updateSourceTitle(idx)
- self.cslist.update(self.sourcelist[idx:])
+ self.cslist.updateItems(self.sourcelist[idx:])
@pyqtSlot(bool)
def _onCheckFinished(self, clean: bool) -> None:
diff --git a/tortoisehg/hgqt/matching.py b/tortoisehg/hgqt/matching.py
--- a/tortoisehg/hgqt/matching.py
+++ b/tortoisehg/hgqt/matching.py
@@ -220,7 +220,7 @@
self.rev_to_match_info.setVisible(False)
self.rev_to_match_info_text.setVisible(True)
def csinfo_update(ctx):
- self.rev_to_match_info.update(ctx)
+ self.rev_to_match_info.updateItems(ctx)
set_csinfo_mode(True)
def csinfo_set_text(text):
self.rev_to_match_info_text.setText(text)
diff --git a/tortoisehg/hgqt/merge.py b/tortoisehg/hgqt/merge.py
--- a/tortoisehg/hgqt/merge.py
+++ b/tortoisehg/hgqt/merge.py
@@ -293,7 +293,7 @@
def repositoryChanged(self):
'repository has detected a change to changelog or parents'
pctx = self.repo[b'.']
- self.localCsInfo.update(pctx)
+ self.localCsInfo.updateItems(pctx)
def canExit(self):
'can merge tool be closed?'
@@ -582,7 +582,7 @@
def currentPage(self):
super(CommitPage, self).currentPage()
self.wizard().setOption(QWizard.WizardOption.NoDefaultButton, True)
- self.mergeCsInfo.update() # show post-merge state
+ self.mergeCsInfo.updateItems() # show post-merge state
self.msgEntry.setText(commit.mergecommitmessage(self.repo))
self.msgEntry.moveCursorToEnd()
@@ -687,5 +687,5 @@
def currentPage(self):
super(ResultPage, self).currentPage()
- self.mergeCsInfo.update(self.repo[b'tip'])
+ self.mergeCsInfo.updateItems(self.repo[b'tip'])
self.wizard().setOption(QWizard.WizardOption.NoCancelButton, True)
diff --git a/tortoisehg/hgqt/p4pending.py b/tortoisehg/hgqt/p4pending.py
--- a/tortoisehg/hgqt/p4pending.py
+++ b/tortoisehg/hgqt/p4pending.py
@@ -86,7 +86,7 @@
except (error.Abort, error.RepoLookupError) as e:
revs = []
self.cslist.clear()
- self.cslist.update(revs)
+ self.cslist.updateItems(revs)
sensitive = not curcl.endswith(b'(submitted)')
self.bb.button(QDialogButtonBox.StandardButton.Ok).setEnabled(sensitive)
self.bb.button(QDialogButtonBox.StandardButton.Discard).setEnabled(sensitive)
diff --git a/tortoisehg/hgqt/prune.py b/tortoisehg/hgqt/prune.py
--- a/tortoisehg/hgqt/prune.py
+++ b/tortoisehg/hgqt/prune.py
@@ -126,7 +126,7 @@
revs = pycompat.maplist(int, bytes(sess.readAll()).splitlines())
else:
revs = []
- self._cslist.update(revs)
+ self._cslist.updateItems(revs)
self.commandChanged.emit()
def canRunCommand(self) -> bool:
diff --git a/tortoisehg/hgqt/rebase.py b/tortoisehg/hgqt/rebase.py
--- a/tortoisehg/hgqt/rebase.py
+++ b/tortoisehg/hgqt/rebase.py
@@ -249,8 +249,8 @@
oldsource = self.opts.get('source', '.')
olddest = self.opts.get('dest', '.')
- self.sourcecsinfo.update(target=olddest)
- self.destcsinfo.update(target=oldsource)
+ self.sourcecsinfo.updateItems(target=olddest)
+ self.destcsinfo.updateItems(target=oldsource)
self.opts['source'] = olddest
self.opts['dest'] = oldsource
diff --git a/tortoisehg/hgqt/resolve.py b/tortoisehg/hgqt/resolve.py
--- a/tortoisehg/hgqt/resolve.py
+++ b/tortoisehg/hgqt/resolve.py
@@ -110,7 +110,7 @@
localrevtitle = qtlib.LabeledSeparator(_('Local revision '
'information'))
localrevinfo = csinfo.create(repo)
- localrevinfo.update(self.mergeState.localctx)
+ localrevinfo.updateItems(self.mergeState.localctx)
vbox.addWidget(localrevtitle)
vbox.addWidget(localrevinfo)
vbox.addStretch()
@@ -121,7 +121,7 @@
otherrevtitle = qtlib.LabeledSeparator(_('Other revision '
'information'))
otherrevinfo = csinfo.create(repo)
- otherrevinfo.update(self.mergeState.otherctx)
+ otherrevinfo.updateItems(self.mergeState.otherctx)
vbox.addWidget(otherrevtitle)
vbox.addWidget(otherrevinfo)
diff --git a/tortoisehg/hgqt/revdetails.py b/tortoisehg/hgqt/revdetails.py
--- a/tortoisehg/hgqt/revdetails.py
+++ b/tortoisehg/hgqt/revdetails.py
@@ -310,7 +310,7 @@
'called by repowidget when repoview changes revisions'
self.ctx = ctx = self.repo[rev]
self.revpanel.set_revision(rev)
- self.revpanel.update(repo=self.repo)
+ self.revpanel.updateItems(repo=self.repo)
msg = ctx.description()
inlinetags = self._repoagent.configBool(
'tortoisehg', 'issue.inlinetags')
diff --git a/tortoisehg/hgqt/thgimport.py b/tortoisehg/hgqt/thgimport.py
--- a/tortoisehg/hgqt/thgimport.py
+++ b/tortoisehg/hgqt/thgimport.py
@@ -245,7 +245,7 @@
if not patches:
self.cslist.clear()
else:
- self.cslist.update([os.path.abspath(p) for p in patches])
+ self.cslist.updateItems([os.path.abspath(p) for p in patches])
self.updatestatus()
self._updateUi()
diff --git a/tortoisehg/hgqt/thgstrip.py b/tortoisehg/hgqt/thgstrip.py
--- a/tortoisehg/hgqt/thgstrip.py
+++ b/tortoisehg/hgqt/thgstrip.py
@@ -148,7 +148,7 @@
striprevs = list(self.repo.changelog.descendants([rev]))
striprevs.append(rev)
striprevs.sort()
- self.cslist.update(striprevs)
+ self.cslist.updateItems(striprevs)
return True
@pyqtSlot()
diff --git a/tortoisehg/hgqt/update.py b/tortoisehg/hgqt/update.py
--- a/tortoisehg/hgqt/update.py
+++ b/tortoisehg/hgqt/update.py
@@ -200,10 +200,10 @@
@pyqtSlot()
def update_info(self) -> None:
- self.p1_info.update(self.ctxs[0].node())
+ self.p1_info.updateItems(self.ctxs[0].node())
merge = len(self.ctxs) == 2
if merge:
- self.p2_info.update(self.ctxs[1].node())
+ self.p2_info.updateItems(self.ctxs[1].node())
new_rev = hglib.fromunicode(self.rev_combo.currentText())
if new_rev == b'null':
self.target_info.setText(_('remove working directory'))
@@ -216,7 +216,7 @@
and not new_ctx.bookmarks():
self.target_info.setText(_('(same as parent)'))
else:
- self.target_info.update(new_ctx)
+ self.target_info.updateItems(new_ctx)
# only show the path combo when there are multiple paths
# and the target revision has subrepos
showpathcombo = self.path_combo.count() > 1 and \