[PATCH 17 of 21 RFC] changegroup: reproduce correct changegroup for tombstoned initial revision

michaeljedgar at gmail.com michaeljedgar at gmail.com
Wed Sep 10 19:26:18 CDT 2014


# HG changeset patch
# User Mike Edgar <adgar at google.com>
# Date 1409575109 -7200
#      Mon Sep 01 14:38:29 2014 +0200
# Node ID a6272d4ba78bbc579ef868ca188ee8e8f3e9e0c6
# Parent  8b22ce5c409431c8ec9fc0ac1b4d93e8816069cb
changegroup: reproduce correct changegroup for tombstoned initial revision

The first revision of a file in a revlog is special-cased in revchunk to
simply emit the full contents of that revision. This will fail when bundling a
file whose initial revision is a censor tombstone.

This change catches the error caused by the tombstone and allows revchunk to
emit the tombstone as an initial revision.

diff -r 8b22ce5c4094 -r a6272d4ba78b mercurial/changegroup.py
--- a/mercurial/changegroup.py	Mon Sep 01 13:49:30 2014 +0200
+++ b/mercurial/changegroup.py	Mon Sep 01 14:38:29 2014 +0200
@@ -417,7 +417,10 @@
 
         prefix = ''
         if base == nullrev:
-            delta = revlog.revision(node)
+            try:
+                delta = revlog.revision(node)
+            except error.CensoredNodeError, e:
+                delta = e.metadata
             prefix = mdiff.trivialdiffheader(len(delta))
         else:
             delta = revlog.revdiff(base, rev)


More information about the Mercurial-devel mailing list