[PATCH 15 of 21 RFC] revlog: allow importing revision deltas based on a censored file tombstone
michaeljedgar at gmail.com
michaeljedgar at gmail.com
Thu Sep 11 00:26:16 UTC 2014
# HG changeset patch
# User Mike Edgar <adgar at google.com>
# Date 1409776499 14400
# Wed Sep 03 16:34:59 2014 -0400
# Node ID 1e85b2cd488fb1b13517345b3ff425e0da7b48b9
# Parent 8adefa28d6fb5816ff9623408ef53c1d2d70f884
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 well-known tombstone text.
diff -r 8adefa28d6fb -r 1e85b2cd488f mercurial/revlog.py
--- a/mercurial/revlog.py Wed Sep 03 16:34:29 2014 -0400
+++ b/mercurial/revlog.py Wed Sep 03 16:34:59 2014 -0400
@@ -1167,7 +1167,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