[PATCH 4 of 5 RFC] changegroup: reproduce correct changegroup for tombstoned initial revision

adgar at google.com adgar at google.com
Wed Oct 15 15:05:14 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 c03f1d585d0987fa6c7657b26230471c7eebc1f3
# Parent  bda2ddd8d3d9f4f5cd24b74560dc2bd2eaaeb236
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 bda2ddd8d3d9 -r c03f1d585d09 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