changeset 47341:24ea3ef35238

censor: do not process sidedata of censored revision while bundling The revision is censored, we should ignore it. Differential Revision: https://phab.mercurial-scm.org/D10801
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 30 May 2021 20:42:51 +0200
parents 3f00665bbea0
children dc3800569157
files mercurial/utils/storageutil.py
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/utils/storageutil.py	Fri May 28 20:00:27 2021 +0200
+++ b/mercurial/utils/storageutil.py	Sun May 30 20:42:51 2021 +0200
@@ -481,13 +481,18 @@
         serialized_sidedata = None
         sidedata_flags = (0, 0)
         if sidedata_helpers:
-            old_sidedata = store.sidedata(rev)
-            sidedata, sidedata_flags = sidedatamod.run_sidedata_helpers(
-                store=store,
-                sidedata_helpers=sidedata_helpers,
-                sidedata=old_sidedata,
-                rev=rev,
-            )
+            try:
+                old_sidedata = store.sidedata(rev)
+            except error.CensoredNodeError:
+                # skip any potential sidedata of the censored revision
+                sidedata = {}
+            else:
+                sidedata, sidedata_flags = sidedatamod.run_sidedata_helpers(
+                    store=store,
+                    sidedata_helpers=sidedata_helpers,
+                    sidedata=old_sidedata,
+                    rev=rev,
+                )
             if sidedata:
                 serialized_sidedata = sidedatamod.serialize_sidedata(sidedata)