Fossil SCM
Provisional changes aimed at preventing delta loops on sync operations that might otherwise occur if a sequence of file changes ends with a file back to its original state after a sequence of two or more intermediate states.
Commit
141b990722ea81e10e5a317dfd8221a32cbc4105
Parent
6fb750d77ceedd5…
1 file changed
+4
-8
+4
-8
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -273,19 +273,15 @@ | ||
| 273 | 273 | Blob *pUuid /* The UUID of the file to send */ |
| 274 | 274 | ){ |
| 275 | 275 | static const char *const azQuery[] = { |
| 276 | 276 | "SELECT pid FROM plink x" |
| 277 | 277 | " WHERE cid=%d" |
| 278 | - " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" | |
| 279 | - " AND NOT EXISTS(SELECT 1 FROM plink y" | |
| 280 | - " WHERE y.pid=x.cid AND y.cid=x.pid)", | |
| 281 | - | |
| 282 | - "SELECT pid FROM mlink x" | |
| 278 | + " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)", | |
| 279 | + | |
| 280 | + "SELECT pid, min(mtime) FROM mlink, event ON mlink.mid=event.objid" | |
| 283 | 281 | " WHERE fid=%d" |
| 284 | 282 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 285 | - " AND NOT EXISTS(SELECT 1 FROM mlink y" | |
| 286 | - " WHERE y.pid=x.fid AND y.fid=x.pid)" | |
| 287 | 283 | }; |
| 288 | 284 | int i; |
| 289 | 285 | Blob src, delta; |
| 290 | 286 | int size = 0; |
| 291 | 287 | int srcId = 0; |
| @@ -303,11 +299,11 @@ | ||
| 303 | 299 | if( size>=blob_size(pContent)-50 ){ |
| 304 | 300 | size = 0; |
| 305 | 301 | }else if( uuid_is_shunned(zUuid) ){ |
| 306 | 302 | size = 0; |
| 307 | 303 | }else{ |
| 308 | - if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1); | |
| 304 | + if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1); | |
| 309 | 305 | blob_appendf(pXfer->pOut, "file %b %s %d\n", pUuid, zUuid, size); |
| 310 | 306 | blob_append(pXfer->pOut, blob_buffer(&delta), size); |
| 311 | 307 | } |
| 312 | 308 | blob_reset(&delta); |
| 313 | 309 | free(zUuid); |
| 314 | 310 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -273,19 +273,15 @@ | |
| 273 | Blob *pUuid /* The UUID of the file to send */ |
| 274 | ){ |
| 275 | static const char *const azQuery[] = { |
| 276 | "SELECT pid FROM plink x" |
| 277 | " WHERE cid=%d" |
| 278 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 279 | " AND NOT EXISTS(SELECT 1 FROM plink y" |
| 280 | " WHERE y.pid=x.cid AND y.cid=x.pid)", |
| 281 | |
| 282 | "SELECT pid FROM mlink x" |
| 283 | " WHERE fid=%d" |
| 284 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 285 | " AND NOT EXISTS(SELECT 1 FROM mlink y" |
| 286 | " WHERE y.pid=x.fid AND y.fid=x.pid)" |
| 287 | }; |
| 288 | int i; |
| 289 | Blob src, delta; |
| 290 | int size = 0; |
| 291 | int srcId = 0; |
| @@ -303,11 +299,11 @@ | |
| 303 | if( size>=blob_size(pContent)-50 ){ |
| 304 | size = 0; |
| 305 | }else if( uuid_is_shunned(zUuid) ){ |
| 306 | size = 0; |
| 307 | }else{ |
| 308 | if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1); |
| 309 | blob_appendf(pXfer->pOut, "file %b %s %d\n", pUuid, zUuid, size); |
| 310 | blob_append(pXfer->pOut, blob_buffer(&delta), size); |
| 311 | } |
| 312 | blob_reset(&delta); |
| 313 | free(zUuid); |
| 314 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -273,19 +273,15 @@ | |
| 273 | Blob *pUuid /* The UUID of the file to send */ |
| 274 | ){ |
| 275 | static const char *const azQuery[] = { |
| 276 | "SELECT pid FROM plink x" |
| 277 | " WHERE cid=%d" |
| 278 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)", |
| 279 | |
| 280 | "SELECT pid, min(mtime) FROM mlink, event ON mlink.mid=event.objid" |
| 281 | " WHERE fid=%d" |
| 282 | " AND NOT EXISTS(SELECT 1 FROM phantom WHERE rid=pid)" |
| 283 | }; |
| 284 | int i; |
| 285 | Blob src, delta; |
| 286 | int size = 0; |
| 287 | int srcId = 0; |
| @@ -303,11 +299,11 @@ | |
| 299 | if( size>=blob_size(pContent)-50 ){ |
| 300 | size = 0; |
| 301 | }else if( uuid_is_shunned(zUuid) ){ |
| 302 | size = 0; |
| 303 | }else{ |
| 304 | if( isPrivate ) blob_append(pXfer->pOut, "private\n", -1); |
| 305 | blob_appendf(pXfer->pOut, "file %b %s %d\n", pUuid, zUuid, size); |
| 306 | blob_append(pXfer->pOut, blob_buffer(&delta), size); |
| 307 | } |
| 308 | blob_reset(&delta); |
| 309 | free(zUuid); |
| 310 |