Patchwork D10801: censor: do not process sidedata of censored revision while bundling

login
register
mail settings
Submitter phabricator
Date May 31, 2021, 2:06 a.m.
Message ID <differential-rev-PHID-DREV-42tfqdaqte6b3b4ouepv-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49121/
State Superseded
Headers show

Comments

phabricator - May 31, 2021, 2:06 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The revision is censored, we should ignore it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10801

AFFECTED FILES
  mercurial/utils/storageutil.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/utils/storageutil.py b/mercurial/utils/storageutil.py
--- a/mercurial/utils/storageutil.py
+++ b/mercurial/utils/storageutil.py
@@ -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)