From patchwork Mon May 3 12:07:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10607: revlog: pass a transaction object to `rewrite_sidedata` From: phabricator X-Patchwork-Id: 48927 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Mon, 3 May 2021 12:07:56 +0000 marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The `_writing` context need one, so we update the function signature before considering using `_writing` in rewrite_sidedata. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10607 AFFECTED FILES mercurial/changegroup.py mercurial/revlog.py CHANGE DETAILS To: marmoute, indygreg, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -3120,7 +3120,7 @@ return d - def rewrite_sidedata(self, helpers, startrev, endrev): + def rewrite_sidedata(self, transaction, helpers, startrev, endrev): if not self.hassidedata: return # inline are not yet supported because they suffer from an issue when diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -449,11 +449,13 @@ if sidedata_helpers: if revlog_constants.KIND_CHANGELOG in sidedata_helpers[1]: - cl.rewrite_sidedata(sidedata_helpers, clstart, clend - 1) + cl.rewrite_sidedata( + trp, sidedata_helpers, clstart, clend - 1 + ) for mf, (startrev, endrev) in touched_manifests.items(): - mf.rewrite_sidedata(sidedata_helpers, startrev, endrev) + mf.rewrite_sidedata(trp, sidedata_helpers, startrev, endrev) for fl, (startrev, endrev) in touched_filelogs.items(): - fl.rewrite_sidedata(sidedata_helpers, startrev, endrev) + fl.rewrite_sidedata(trp, sidedata_helpers, startrev, endrev) # making sure the value exists tr.changes.setdefault(b'changegroup-count-changesets', 0)