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.
Commit
0526c85d7b6eec292511809b8a71a595603bc1c49565420b2960a0efd0455210
Parent
c149b999e88e114…
1 file changed
+7
-3
+7
-3
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -2635,14 +2635,18 @@ | ||
| 2635 | 2635 | ){ |
| 2636 | 2636 | int rid; |
| 2637 | 2637 | int isPriv = xfer.nToken>=3 && blob_eq(&xfer.aToken[2],"1"); |
| 2638 | 2638 | rid = rid_from_uuid(&xfer.aToken[1], 0, 0); |
| 2639 | 2639 | if( rid>0 ){ |
| 2640 | - if( isPriv ){ | |
| 2641 | - content_make_private(rid); | |
| 2642 | - }else{ | |
| 2640 | + if( !isPriv ){ | |
| 2643 | 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); | |
| 2644 | 2648 | } |
| 2645 | 2649 | }else if( isPriv && !g.perm.Private ){ |
| 2646 | 2650 | /* ignore private files */ |
| 2647 | 2651 | }else if( (syncFlags & (SYNC_PULL|SYNC_CLONE))!=0 ){ |
| 2648 | 2652 | rid = content_new(blob_str(&xfer.aToken[1]), isPriv); |
| 2649 | 2653 |
| --- 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 |