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

login
register
mail settings
Submitter adgar@google.com
Date Nov. 6, 2014, 7:03 p.m.
Message ID <141a55f9e25968229e65.1415300588@adgar.nyc.corp.google.com>
Download mbox | patch
Permalink /patch/6609/
State Changes Requested
Headers show

Comments

adgar@google.com - Nov. 6, 2014, 7:03 p.m.
# HG changeset patch
# User Mike Edgar <adgar@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.

Patch

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)