Fossil SCM

If a remote has forbid-delta-manifests set and a client with autocommit enabled tries to commit, the remote tells the client to avoid deltas and the client obeys, unless the explicit --delta option is used.

drh 2020-07-24 11:49 trunk
Commit 9116c6fbeaff18cb2336d3642c907b8a252058bbddc5c5be3f88e508d3770a1a
+22 -14
--- src/checkin.c
+++ src/checkin.c
@@ -2233,24 +2233,10 @@
22332233
int i;
22342234
for(i=0; i<nTag; i++) sCiInfo.azTag[i] = mprintf("%F", sCiInfo.azTag[i]);
22352235
qsort((void*)sCiInfo.azTag, nTag, sizeof(sCiInfo.azTag[0]), tagCmp);
22362236
}
22372237
2238
- /* So that older versions of Fossil (that do not understand delta-
2239
- ** manifest) can continue to use this repository, do not create a new
2240
- ** delta-manifest unless this repository already contains one or more
2241
- ** delta-manifests, or unless the delta-manifest is explicitly requested
2242
- ** by the --delta option.
2243
- **
2244
- ** The forbid-delta-manifests setting prevents new delta manifests.
2245
- */
2246
- if( (!forceDelta && !db_get_boolean("seen-delta-manifest",0))
2247
- || db_get_boolean("forbid-delta-manifests",0)
2248
- ){
2249
- forceBaseline = 1;
2250
- }
2251
-
22522238
/*
22532239
** Autosync if autosync is enabled and this is not a private check-in.
22542240
*/
22552241
if( !g.markPrivate ){
22562242
int syncFlags = SYNC_PULL;
@@ -2259,10 +2245,32 @@
22592245
}
22602246
if( autosync_loop(syncFlags, db_get_int("autosync-tries", 1), 1) ){
22612247
fossil_exit(1);
22622248
}
22632249
}
2250
+
2251
+ /* So that older versions of Fossil (that do not understand delta-
2252
+ ** manifest) can continue to use this repository, do not create a new
2253
+ ** delta-manifest unless this repository already contains one or more
2254
+ ** delta-manifests, or unless the delta-manifest is explicitly requested
2255
+ ** by the --delta option.
2256
+ **
2257
+ ** The forbid-delta-manifests setting prevents new delta manifests.
2258
+ **
2259
+ ** If the remote repository sent an avoid-delta-manifests pragma on
2260
+ ** the autosync above, then also try to avoid deltas, unless the
2261
+ ** --delta option is specified. The remote repo will send the
2262
+ ** avoid-delta-manifests pragma if it has its "forbid-delta-manifests"
2263
+ ** setting is enabled.
2264
+ */
2265
+ if( !db_get_boolean("seen-delta-manifest",0)
2266
+ || db_get_boolean("forbid-delta-manifests",0)
2267
+ || g.bAvoidDeltaManifests
2268
+ ){
2269
+ if( !forceDelta ) forceBaseline = 1;
2270
+ }
2271
+
22642272
22652273
/* Require confirmation to continue with the check-in if there is
22662274
** clock skew
22672275
*/
22682276
if( g.clockSkewSeen ){
22692277
--- src/checkin.c
+++ src/checkin.c
@@ -2233,24 +2233,10 @@
2233 int i;
2234 for(i=0; i<nTag; i++) sCiInfo.azTag[i] = mprintf("%F", sCiInfo.azTag[i]);
2235 qsort((void*)sCiInfo.azTag, nTag, sizeof(sCiInfo.azTag[0]), tagCmp);
2236 }
2237
2238 /* So that older versions of Fossil (that do not understand delta-
2239 ** manifest) can continue to use this repository, do not create a new
2240 ** delta-manifest unless this repository already contains one or more
2241 ** delta-manifests, or unless the delta-manifest is explicitly requested
2242 ** by the --delta option.
2243 **
2244 ** The forbid-delta-manifests setting prevents new delta manifests.
2245 */
2246 if( (!forceDelta && !db_get_boolean("seen-delta-manifest",0))
2247 || db_get_boolean("forbid-delta-manifests",0)
2248 ){
2249 forceBaseline = 1;
2250 }
2251
2252 /*
2253 ** Autosync if autosync is enabled and this is not a private check-in.
2254 */
2255 if( !g.markPrivate ){
2256 int syncFlags = SYNC_PULL;
@@ -2259,10 +2245,32 @@
2259 }
2260 if( autosync_loop(syncFlags, db_get_int("autosync-tries", 1), 1) ){
2261 fossil_exit(1);
2262 }
2263 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2264
2265 /* Require confirmation to continue with the check-in if there is
2266 ** clock skew
2267 */
2268 if( g.clockSkewSeen ){
2269
--- src/checkin.c
+++ src/checkin.c
@@ -2233,24 +2233,10 @@
2233 int i;
2234 for(i=0; i<nTag; i++) sCiInfo.azTag[i] = mprintf("%F", sCiInfo.azTag[i]);
2235 qsort((void*)sCiInfo.azTag, nTag, sizeof(sCiInfo.azTag[0]), tagCmp);
2236 }
2237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2238 /*
2239 ** Autosync if autosync is enabled and this is not a private check-in.
2240 */
2241 if( !g.markPrivate ){
2242 int syncFlags = SYNC_PULL;
@@ -2259,10 +2245,32 @@
2245 }
2246 if( autosync_loop(syncFlags, db_get_int("autosync-tries", 1), 1) ){
2247 fossil_exit(1);
2248 }
2249 }
2250
2251 /* So that older versions of Fossil (that do not understand delta-
2252 ** manifest) can continue to use this repository, do not create a new
2253 ** delta-manifest unless this repository already contains one or more
2254 ** delta-manifests, or unless the delta-manifest is explicitly requested
2255 ** by the --delta option.
2256 **
2257 ** The forbid-delta-manifests setting prevents new delta manifests.
2258 **
2259 ** If the remote repository sent an avoid-delta-manifests pragma on
2260 ** the autosync above, then also try to avoid deltas, unless the
2261 ** --delta option is specified. The remote repo will send the
2262 ** avoid-delta-manifests pragma if it has its "forbid-delta-manifests"
2263 ** setting is enabled.
2264 */
2265 if( !db_get_boolean("seen-delta-manifest",0)
2266 || db_get_boolean("forbid-delta-manifests",0)
2267 || g.bAvoidDeltaManifests
2268 ){
2269 if( !forceDelta ) forceBaseline = 1;
2270 }
2271
2272
2273 /* Require confirmation to continue with the check-in if there is
2274 ** clock skew
2275 */
2276 if( g.clockSkewSeen ){
2277
+1
--- src/main.c
+++ src/main.c
@@ -264,10 +264,11 @@
264264
int anAuxCols[MX_AUX]; /* Number of columns for option() values */
265265
int allowSymlinks; /* Cached "allow-symlinks" option */
266266
int mainTimerId; /* Set to fossil_timer_start() */
267267
int nPendingRequest; /* # of HTTP requests in "fossil server" */
268268
int nRequest; /* Total # of HTTP request */
269
+ int bAvoidDeltaManifests; /* Avoid using delta manifests if true */
269270
#ifdef FOSSIL_ENABLE_JSON
270271
struct FossilJsonBits {
271272
int isJsonMode; /* True if running in JSON mode, else
272273
false. This changes how errors are
273274
reported. In JSON mode we try to
274275
--- src/main.c
+++ src/main.c
@@ -264,10 +264,11 @@
264 int anAuxCols[MX_AUX]; /* Number of columns for option() values */
265 int allowSymlinks; /* Cached "allow-symlinks" option */
266 int mainTimerId; /* Set to fossil_timer_start() */
267 int nPendingRequest; /* # of HTTP requests in "fossil server" */
268 int nRequest; /* Total # of HTTP request */
 
269 #ifdef FOSSIL_ENABLE_JSON
270 struct FossilJsonBits {
271 int isJsonMode; /* True if running in JSON mode, else
272 false. This changes how errors are
273 reported. In JSON mode we try to
274
--- src/main.c
+++ src/main.c
@@ -264,10 +264,11 @@
264 int anAuxCols[MX_AUX]; /* Number of columns for option() values */
265 int allowSymlinks; /* Cached "allow-symlinks" option */
266 int mainTimerId; /* Set to fossil_timer_start() */
267 int nPendingRequest; /* # of HTTP requests in "fossil server" */
268 int nRequest; /* Total # of HTTP request */
269 int bAvoidDeltaManifests; /* Avoid using delta manifests if true */
270 #ifdef FOSSIL_ENABLE_JSON
271 struct FossilJsonBits {
272 int isJsonMode; /* True if running in JSON mode, else
273 false. This changes how errors are
274 reported. In JSON mode we try to
275
+12
--- src/xfer.c
+++ src/xfer.c
@@ -1679,10 +1679,13 @@
16791679
"VALUES('ci-lock-%q',json_object('login',%Q,'clientid',%Q),now())",
16801680
blob_str(&xfer.aToken[2]), g.zLogin,
16811681
blob_str(&xfer.aToken[3])
16821682
);
16831683
}
1684
+ if( db_get_boolean("forbid-delta-manifests",0) ){
1685
+ @ pragma avoid-delta-manifests
1686
+ }
16841687
}
16851688
16861689
/* pragma ci-unlock CLIENT-ID
16871690
**
16881691
** Remove any locks previously held by CLIENT-ID. Clients send this
@@ -2516,10 +2519,19 @@
25162519
}else{
25172520
fossil_print("\nParent check-in locked by %s\n", zUser);
25182521
}
25192522
g.ckinLockFail = fossil_strdup(zUser);
25202523
}
2524
+
2525
+ /* pragma avoid-delta-manifests
2526
+ **
2527
+ ** Discourage the use of delta manifests. The remote side sends
2528
+ ** this pragma when its forbid-delta-manifests setting is true.
2529
+ */
2530
+ else if( blob_eq(&xfer.aToken[1], "avoid-delta-manifests") ){
2531
+ g.bAvoidDeltaManifests = 1;
2532
+ }
25212533
}else
25222534
25232535
/* error MESSAGE
25242536
**
25252537
** The server is reporting an error. The client will abandon
25262538
--- src/xfer.c
+++ src/xfer.c
@@ -1679,10 +1679,13 @@
1679 "VALUES('ci-lock-%q',json_object('login',%Q,'clientid',%Q),now())",
1680 blob_str(&xfer.aToken[2]), g.zLogin,
1681 blob_str(&xfer.aToken[3])
1682 );
1683 }
 
 
 
1684 }
1685
1686 /* pragma ci-unlock CLIENT-ID
1687 **
1688 ** Remove any locks previously held by CLIENT-ID. Clients send this
@@ -2516,10 +2519,19 @@
2516 }else{
2517 fossil_print("\nParent check-in locked by %s\n", zUser);
2518 }
2519 g.ckinLockFail = fossil_strdup(zUser);
2520 }
 
 
 
 
 
 
 
 
 
2521 }else
2522
2523 /* error MESSAGE
2524 **
2525 ** The server is reporting an error. The client will abandon
2526
--- src/xfer.c
+++ src/xfer.c
@@ -1679,10 +1679,13 @@
1679 "VALUES('ci-lock-%q',json_object('login',%Q,'clientid',%Q),now())",
1680 blob_str(&xfer.aToken[2]), g.zLogin,
1681 blob_str(&xfer.aToken[3])
1682 );
1683 }
1684 if( db_get_boolean("forbid-delta-manifests",0) ){
1685 @ pragma avoid-delta-manifests
1686 }
1687 }
1688
1689 /* pragma ci-unlock CLIENT-ID
1690 **
1691 ** Remove any locks previously held by CLIENT-ID. Clients send this
@@ -2516,10 +2519,19 @@
2519 }else{
2520 fossil_print("\nParent check-in locked by %s\n", zUser);
2521 }
2522 g.ckinLockFail = fossil_strdup(zUser);
2523 }
2524
2525 /* pragma avoid-delta-manifests
2526 **
2527 ** Discourage the use of delta manifests. The remote side sends
2528 ** this pragma when its forbid-delta-manifests setting is true.
2529 */
2530 else if( blob_eq(&xfer.aToken[1], "avoid-delta-manifests") ){
2531 g.bAvoidDeltaManifests = 1;
2532 }
2533 }else
2534
2535 /* error MESSAGE
2536 **
2537 ** The server is reporting an error. The client will abandon
2538

Keyboard Shortcuts

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