Fossil SCM
Remove the unused uvStatus variable from the client-side sync implementation.
Commit
515229c5cd33428fe9c11493d2c34841f38e9dcd
Parent
16306153c09dd89…
1 file changed
-5
-5
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1704,11 +1704,10 @@ | ||
| 1704 | 1704 | int nArtifactSent = 0; /* Total artifacts sent */ |
| 1705 | 1705 | int nArtifactRcvd = 0; /* Total artifacts received */ |
| 1706 | 1706 | const char *zOpType = 0;/* Push, Pull, Sync, Clone */ |
| 1707 | 1707 | double rSkew = 0.0; /* Maximum time skew */ |
| 1708 | 1708 | int uvHashSent = 0; /* The "pragma uv-hash" message has been sent */ |
| 1709 | - int uvStatus = 0; /* 0: no I/O. 1: pull-only 2: push-and-pull */ | |
| 1710 | 1709 | int uvDoPush = 0; /* Generate uvfile messages to send to server */ |
| 1711 | 1710 | int nUvGimmeSent = 0; /* Number of uvgimme cards sent on this cycle */ |
| 1712 | 1711 | int nUvFileRcvd = 0; /* Number of uvfile cards received on this cycle */ |
| 1713 | 1712 | sqlite3_int64 mtime; /* Modification time on a UV file */ |
| 1714 | 1713 | |
| @@ -1888,11 +1887,10 @@ | ||
| 1888 | 1887 | ** Or, if the SYNC_UV_REVERT flag is set, delete the local unversioned |
| 1889 | 1888 | ** files that do not exist on the server. |
| 1890 | 1889 | */ |
| 1891 | 1890 | if( uvDoPush ){ |
| 1892 | 1891 | assert( (syncFlags & SYNC_UNVERSIONED)!=0 ); |
| 1893 | - assert( uvStatus==2 ); | |
| 1894 | 1892 | if( syncFlags & SYNC_UV_REVERT ){ |
| 1895 | 1893 | db_multi_exec( |
| 1896 | 1894 | "DELETE FROM unversioned" |
| 1897 | 1895 | " WHERE name IN (SELECT name FROM uv_tosend);" |
| 1898 | 1896 | "DELETE FROM uv_tosend;" |
| @@ -2111,11 +2109,10 @@ | ||
| 2111 | 2109 | && (blob_eq(&xfer.aToken[3],"-") || blob_is_uuid(&xfer.aToken[3])) |
| 2112 | 2110 | ){ |
| 2113 | 2111 | const char *zName = blob_str(&xfer.aToken[1]); |
| 2114 | 2112 | const char *zHash = blob_str(&xfer.aToken[3]); |
| 2115 | 2113 | int iStatus; |
| 2116 | - if( uvStatus==0 ) uvStatus = 2; | |
| 2117 | 2114 | iStatus = unversioned_status(zName, mtime, zHash); |
| 2118 | 2115 | if( (syncFlags & SYNC_UV_REVERT)!=0 && iStatus==4 ) iStatus = 2; |
| 2119 | 2116 | if( iStatus<=1 ){ |
| 2120 | 2117 | if( zHash[0]!='-' ){ |
| 2121 | 2118 | blob_appendf(xfer.pOut, "uvgimme %s\n", zName); |
| @@ -2253,14 +2250,12 @@ | ||
| 2253 | 2250 | ** "uv-pull-only" pragma so that the client will know not to waste |
| 2254 | 2251 | ** bandwidth trying to upload unversioned content. If the server |
| 2255 | 2252 | ** does accept new unversioned content, it sends "uv-push-ok". |
| 2256 | 2253 | */ |
| 2257 | 2254 | if( blob_eq(&xfer.aToken[1], "uv-pull-only") ){ |
| 2258 | - uvStatus = 1; | |
| 2259 | 2255 | if( syncFlags & SYNC_UV_REVERT ) uvDoPush = 1; |
| 2260 | 2256 | }else if( blob_eq(&xfer.aToken[1], "uv-push-ok") ){ |
| 2261 | - uvStatus = 2; | |
| 2262 | 2257 | uvDoPush = 1; |
| 2263 | 2258 | } |
| 2264 | 2259 | }else |
| 2265 | 2260 | |
| 2266 | 2261 | /* error MESSAGE |
| 2267 | 2262 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1704,11 +1704,10 @@ | |
| 1704 | int nArtifactSent = 0; /* Total artifacts sent */ |
| 1705 | int nArtifactRcvd = 0; /* Total artifacts received */ |
| 1706 | const char *zOpType = 0;/* Push, Pull, Sync, Clone */ |
| 1707 | double rSkew = 0.0; /* Maximum time skew */ |
| 1708 | int uvHashSent = 0; /* The "pragma uv-hash" message has been sent */ |
| 1709 | int uvStatus = 0; /* 0: no I/O. 1: pull-only 2: push-and-pull */ |
| 1710 | int uvDoPush = 0; /* Generate uvfile messages to send to server */ |
| 1711 | int nUvGimmeSent = 0; /* Number of uvgimme cards sent on this cycle */ |
| 1712 | int nUvFileRcvd = 0; /* Number of uvfile cards received on this cycle */ |
| 1713 | sqlite3_int64 mtime; /* Modification time on a UV file */ |
| 1714 | |
| @@ -1888,11 +1887,10 @@ | |
| 1888 | ** Or, if the SYNC_UV_REVERT flag is set, delete the local unversioned |
| 1889 | ** files that do not exist on the server. |
| 1890 | */ |
| 1891 | if( uvDoPush ){ |
| 1892 | assert( (syncFlags & SYNC_UNVERSIONED)!=0 ); |
| 1893 | assert( uvStatus==2 ); |
| 1894 | if( syncFlags & SYNC_UV_REVERT ){ |
| 1895 | db_multi_exec( |
| 1896 | "DELETE FROM unversioned" |
| 1897 | " WHERE name IN (SELECT name FROM uv_tosend);" |
| 1898 | "DELETE FROM uv_tosend;" |
| @@ -2111,11 +2109,10 @@ | |
| 2111 | && (blob_eq(&xfer.aToken[3],"-") || blob_is_uuid(&xfer.aToken[3])) |
| 2112 | ){ |
| 2113 | const char *zName = blob_str(&xfer.aToken[1]); |
| 2114 | const char *zHash = blob_str(&xfer.aToken[3]); |
| 2115 | int iStatus; |
| 2116 | if( uvStatus==0 ) uvStatus = 2; |
| 2117 | iStatus = unversioned_status(zName, mtime, zHash); |
| 2118 | if( (syncFlags & SYNC_UV_REVERT)!=0 && iStatus==4 ) iStatus = 2; |
| 2119 | if( iStatus<=1 ){ |
| 2120 | if( zHash[0]!='-' ){ |
| 2121 | blob_appendf(xfer.pOut, "uvgimme %s\n", zName); |
| @@ -2253,14 +2250,12 @@ | |
| 2253 | ** "uv-pull-only" pragma so that the client will know not to waste |
| 2254 | ** bandwidth trying to upload unversioned content. If the server |
| 2255 | ** does accept new unversioned content, it sends "uv-push-ok". |
| 2256 | */ |
| 2257 | if( blob_eq(&xfer.aToken[1], "uv-pull-only") ){ |
| 2258 | uvStatus = 1; |
| 2259 | if( syncFlags & SYNC_UV_REVERT ) uvDoPush = 1; |
| 2260 | }else if( blob_eq(&xfer.aToken[1], "uv-push-ok") ){ |
| 2261 | uvStatus = 2; |
| 2262 | uvDoPush = 1; |
| 2263 | } |
| 2264 | }else |
| 2265 | |
| 2266 | /* error MESSAGE |
| 2267 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1704,11 +1704,10 @@ | |
| 1704 | int nArtifactSent = 0; /* Total artifacts sent */ |
| 1705 | int nArtifactRcvd = 0; /* Total artifacts received */ |
| 1706 | const char *zOpType = 0;/* Push, Pull, Sync, Clone */ |
| 1707 | double rSkew = 0.0; /* Maximum time skew */ |
| 1708 | int uvHashSent = 0; /* The "pragma uv-hash" message has been sent */ |
| 1709 | int uvDoPush = 0; /* Generate uvfile messages to send to server */ |
| 1710 | int nUvGimmeSent = 0; /* Number of uvgimme cards sent on this cycle */ |
| 1711 | int nUvFileRcvd = 0; /* Number of uvfile cards received on this cycle */ |
| 1712 | sqlite3_int64 mtime; /* Modification time on a UV file */ |
| 1713 | |
| @@ -1888,11 +1887,10 @@ | |
| 1887 | ** Or, if the SYNC_UV_REVERT flag is set, delete the local unversioned |
| 1888 | ** files that do not exist on the server. |
| 1889 | */ |
| 1890 | if( uvDoPush ){ |
| 1891 | assert( (syncFlags & SYNC_UNVERSIONED)!=0 ); |
| 1892 | if( syncFlags & SYNC_UV_REVERT ){ |
| 1893 | db_multi_exec( |
| 1894 | "DELETE FROM unversioned" |
| 1895 | " WHERE name IN (SELECT name FROM uv_tosend);" |
| 1896 | "DELETE FROM uv_tosend;" |
| @@ -2111,11 +2109,10 @@ | |
| 2109 | && (blob_eq(&xfer.aToken[3],"-") || blob_is_uuid(&xfer.aToken[3])) |
| 2110 | ){ |
| 2111 | const char *zName = blob_str(&xfer.aToken[1]); |
| 2112 | const char *zHash = blob_str(&xfer.aToken[3]); |
| 2113 | int iStatus; |
| 2114 | iStatus = unversioned_status(zName, mtime, zHash); |
| 2115 | if( (syncFlags & SYNC_UV_REVERT)!=0 && iStatus==4 ) iStatus = 2; |
| 2116 | if( iStatus<=1 ){ |
| 2117 | if( zHash[0]!='-' ){ |
| 2118 | blob_appendf(xfer.pOut, "uvgimme %s\n", zName); |
| @@ -2253,14 +2250,12 @@ | |
| 2250 | ** "uv-pull-only" pragma so that the client will know not to waste |
| 2251 | ** bandwidth trying to upload unversioned content. If the server |
| 2252 | ** does accept new unversioned content, it sends "uv-push-ok". |
| 2253 | */ |
| 2254 | if( blob_eq(&xfer.aToken[1], "uv-pull-only") ){ |
| 2255 | if( syncFlags & SYNC_UV_REVERT ) uvDoPush = 1; |
| 2256 | }else if( blob_eq(&xfer.aToken[1], "uv-push-ok") ){ |
| 2257 | uvDoPush = 1; |
| 2258 | } |
| 2259 | }else |
| 2260 | |
| 2261 | /* error MESSAGE |
| 2262 |