[PATCH 2 of 5 RFC] revlog: allow importing revision deltas based on a censored file tombstone

adgar at google.com adgar at google.com
Wed Oct 15 15:05:12 CDT 2014


# HG changeset patch
# User Mike Edgar <adgar at google.com>
# Date 1409776499 14400
#      Wed Sep 03 16:34:59 2014 -0400
# Node ID 4416e2cfe289eb64d6d6b1907723c2860e45e79c
# Parent  2f20191b7d5f96b9f58080350b2099fb03e11efa
revlog: allow importing revision deltas based on a censored file tombstone

Whenever a changegroup is imported with a non-null delta base, the delta base
will be materialized, which could fail if that base revision is censored. This
change allows delta application against the tombstone to proceed, setting the
base text to the tombstoned censorship metadata.

diff -r 2f20191b7d5f -r 4416e2cfe289 mercurial/revlog.py
--- a/mercurial/revlog.py	Sun Sep 14 18:57:59 2014 -0400
+++ b/mercurial/revlog.py	Wed Sep 03 16:34:59 2014 -0400
@@ -1175,7 +1175,10 @@
             if dfh:
                 dfh.flush()
             ifh.flush()
-            basetext = self.revision(self.node(cachedelta[0]))
+            try:
+                basetext = self.revision(self.node(cachedelta[0]))
+            except CensoredNodeError, e:
+                basetext = e.metadata
             btext[0] = mdiff.patch(basetext, cachedelta[1])
             try:
                 self.checkhash(btext[0], p1, p2, node)


More information about the Mercurial-devel mailing list