Fossil SCM

As a safety precaution against changes made in [ecb705359a] and [b8c1d429cb], content_deltify() now explicitly checks whether its main input RID refers to a phantom and skips further work if it is.

stephan 2021-02-22 04:35 trunk
Commit 188ffef23db280478f6f2420531bd8c1c4fe9e71ff4f7310dec7621d89715002
1 file changed +5
--- src/content.c
+++ src/content.c
@@ -798,10 +798,12 @@
798798
** gives the smallest delta is choosen.
799799
**
800800
** If rid is already a delta from some other place then no
801801
** conversion occurs and this is a no-op unless force==1. If force==1,
802802
** then nSrc must also be 1.
803
+**
804
+** If rid refers to a phantom, no delta is created.
803805
**
804806
** Never generate a delta that carries a private artifact into a public
805807
** artifact. Otherwise, when we go to send the public artifact on a
806808
** sync operation, the other end of the sync will never be able to receive
807809
** the source of the delta. It is OK to delta private->private and
@@ -829,10 +831,13 @@
829831
830832
/* If rid is already a child (a delta) of some other artifact, return
831833
** immediately if the force flags is false
832834
*/
833835
if( !force && delta_source_rid(rid)>0 ) return 0;
836
+
837
+ /* If rid refers to a phantom, skip deltification. */
838
+ if( 0==content_is_available(rid) ) return 0;
834839
835840
/* Get the complete content of the object to be delta-ed. If the size
836841
** is less than 50 bytes, then there really is no point in trying to do
837842
** a delta, so return immediately
838843
*/
839844
--- src/content.c
+++ src/content.c
@@ -798,10 +798,12 @@
798 ** gives the smallest delta is choosen.
799 **
800 ** If rid is already a delta from some other place then no
801 ** conversion occurs and this is a no-op unless force==1. If force==1,
802 ** then nSrc must also be 1.
 
 
803 **
804 ** Never generate a delta that carries a private artifact into a public
805 ** artifact. Otherwise, when we go to send the public artifact on a
806 ** sync operation, the other end of the sync will never be able to receive
807 ** the source of the delta. It is OK to delta private->private and
@@ -829,10 +831,13 @@
829
830 /* If rid is already a child (a delta) of some other artifact, return
831 ** immediately if the force flags is false
832 */
833 if( !force && delta_source_rid(rid)>0 ) return 0;
 
 
 
834
835 /* Get the complete content of the object to be delta-ed. If the size
836 ** is less than 50 bytes, then there really is no point in trying to do
837 ** a delta, so return immediately
838 */
839
--- src/content.c
+++ src/content.c
@@ -798,10 +798,12 @@
798 ** gives the smallest delta is choosen.
799 **
800 ** If rid is already a delta from some other place then no
801 ** conversion occurs and this is a no-op unless force==1. If force==1,
802 ** then nSrc must also be 1.
803 **
804 ** If rid refers to a phantom, no delta is created.
805 **
806 ** Never generate a delta that carries a private artifact into a public
807 ** artifact. Otherwise, when we go to send the public artifact on a
808 ** sync operation, the other end of the sync will never be able to receive
809 ** the source of the delta. It is OK to delta private->private and
@@ -829,10 +831,13 @@
831
832 /* If rid is already a child (a delta) of some other artifact, return
833 ** immediately if the force flags is false
834 */
835 if( !force && delta_source_rid(rid)>0 ) return 0;
836
837 /* If rid refers to a phantom, skip deltification. */
838 if( 0==content_is_available(rid) ) return 0;
839
840 /* Get the complete content of the object to be delta-ed. If the size
841 ** is less than 50 bytes, then there really is no point in trying to do
842 ** a delta, so return immediately
843 */
844

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button