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

login
register
mail settings
Submitter adgar@google.com
Date Oct. 15, 2014, 8:05 p.m.
Message ID <4416e2cfe289eb64d6d6.1413403512@adgar.nyc.corp.google.com>
Download mbox | patch
Permalink /patch/6295/
State Deferred
Headers show

Comments

adgar@google.com - Oct. 15, 2014, 8:05 p.m.
# HG changeset patch
# User Mike Edgar <adgar@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.

Patch

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)