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

Mike Edgar adgar at google.com
Thu Nov 6 13:03:08 CST 2014


# HG changeset patch
# User Mike Edgar <adgar at google.com>
# Date 1409776499 14400
#      Wed Sep 03 16:34:59 2014 -0400
# Node ID 141a55f9e25968229e656e06cdd854cc132d6657
# Parent  f54bf90d831c689fc0c0be93d733851644dc8a86
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 f54bf90d831c -r 141a55f9e259 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