Fossil SCM

In client_sync(), let an igot card mark an artifact that the client holds as private only in a sync of private content. In an ordinary pull a server could make a public check-in in the client private, after which a push or sync no longer sent it. A phantom is still marked, so that it is not asked for again.

dmestas 2026-11-15 12:39 UTC small-fixes-2
Commit 0526c85d7b6eec292511809b8a71a595603bc1c49565420b2960a0efd0455210
1 file changed +7 -3
+7 -3
--- src/xfer.c
+++ src/xfer.c
@@ -2635,14 +2635,18 @@
26352635
){
26362636
int rid;
26372637
int isPriv = xfer.nToken>=3 && blob_eq(&xfer.aToken[2],"1");
26382638
rid = rid_from_uuid(&xfer.aToken[1], 0, 0);
26392639
if( rid>0 ){
2640
- if( isPriv ){
2641
- content_make_private(rid);
2642
- }else{
2640
+ if( !isPriv ){
26432641
content_make_public(rid);
2642
+ }else if( g.perm.Private
2643
+ || db_exists("SELECT 1 FROM phantom WHERE rid=%d", rid) ){
2644
+ /* Outside a sync of private content, only an artifact that is
2645
+ ** still a phantom here is marked, so that it is not asked for
2646
+ ** again. Content that this repository holds stays public. */
2647
+ content_make_private(rid);
26442648
}
26452649
}else if( isPriv && !g.perm.Private ){
26462650
/* ignore private files */
26472651
}else if( (syncFlags & (SYNC_PULL|SYNC_CLONE))!=0 ){
26482652
rid = content_new(blob_str(&xfer.aToken[1]), isPriv);
26492653
--- src/xfer.c
+++ src/xfer.c
@@ -2635,14 +2635,18 @@
2635 ){
2636 int rid;
2637 int isPriv = xfer.nToken>=3 && blob_eq(&xfer.aToken[2],"1");
2638 rid = rid_from_uuid(&xfer.aToken[1], 0, 0);
2639 if( rid>0 ){
2640 if( isPriv ){
2641 content_make_private(rid);
2642 }else{
2643 content_make_public(rid);
 
 
 
 
 
 
2644 }
2645 }else if( isPriv && !g.perm.Private ){
2646 /* ignore private files */
2647 }else if( (syncFlags & (SYNC_PULL|SYNC_CLONE))!=0 ){
2648 rid = content_new(blob_str(&xfer.aToken[1]), isPriv);
2649
--- src/xfer.c
+++ src/xfer.c
@@ -2635,14 +2635,18 @@
2635 ){
2636 int rid;
2637 int isPriv = xfer.nToken>=3 && blob_eq(&xfer.aToken[2],"1");
2638 rid = rid_from_uuid(&xfer.aToken[1], 0, 0);
2639 if( rid>0 ){
2640 if( !isPriv ){
 
 
2641 content_make_public(rid);
2642 }else if( g.perm.Private
2643 || db_exists("SELECT 1 FROM phantom WHERE rid=%d", rid) ){
2644 /* Outside a sync of private content, only an artifact that is
2645 ** still a phantom here is marked, so that it is not asked for
2646 ** again. Content that this repository holds stays public. */
2647 content_make_private(rid);
2648 }
2649 }else if( isPriv && !g.perm.Private ){
2650 /* ignore private files */
2651 }else if( (syncFlags & (SYNC_PULL|SYNC_CLONE))!=0 ){
2652 rid = content_new(blob_str(&xfer.aToken[1]), isPriv);
2653

Keyboard Shortcuts

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