Fossil SCM

Remove the unused uvStatus variable from the client-side sync implementation.

drh 2016-09-19 18:48 trunk
Commit 515229c5cd33428fe9c11493d2c34841f38e9dcd
1 file changed -5
-5
--- src/xfer.c
+++ src/xfer.c
@@ -1704,11 +1704,10 @@
17041704
int nArtifactSent = 0; /* Total artifacts sent */
17051705
int nArtifactRcvd = 0; /* Total artifacts received */
17061706
const char *zOpType = 0;/* Push, Pull, Sync, Clone */
17071707
double rSkew = 0.0; /* Maximum time skew */
17081708
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 */
17101709
int uvDoPush = 0; /* Generate uvfile messages to send to server */
17111710
int nUvGimmeSent = 0; /* Number of uvgimme cards sent on this cycle */
17121711
int nUvFileRcvd = 0; /* Number of uvfile cards received on this cycle */
17131712
sqlite3_int64 mtime; /* Modification time on a UV file */
17141713
@@ -1888,11 +1887,10 @@
18881887
** Or, if the SYNC_UV_REVERT flag is set, delete the local unversioned
18891888
** files that do not exist on the server.
18901889
*/
18911890
if( uvDoPush ){
18921891
assert( (syncFlags & SYNC_UNVERSIONED)!=0 );
1893
- assert( uvStatus==2 );
18941892
if( syncFlags & SYNC_UV_REVERT ){
18951893
db_multi_exec(
18961894
"DELETE FROM unversioned"
18971895
" WHERE name IN (SELECT name FROM uv_tosend);"
18981896
"DELETE FROM uv_tosend;"
@@ -2111,11 +2109,10 @@
21112109
&& (blob_eq(&xfer.aToken[3],"-") || blob_is_uuid(&xfer.aToken[3]))
21122110
){
21132111
const char *zName = blob_str(&xfer.aToken[1]);
21142112
const char *zHash = blob_str(&xfer.aToken[3]);
21152113
int iStatus;
2116
- if( uvStatus==0 ) uvStatus = 2;
21172114
iStatus = unversioned_status(zName, mtime, zHash);
21182115
if( (syncFlags & SYNC_UV_REVERT)!=0 && iStatus==4 ) iStatus = 2;
21192116
if( iStatus<=1 ){
21202117
if( zHash[0]!='-' ){
21212118
blob_appendf(xfer.pOut, "uvgimme %s\n", zName);
@@ -2253,14 +2250,12 @@
22532250
** "uv-pull-only" pragma so that the client will know not to waste
22542251
** bandwidth trying to upload unversioned content. If the server
22552252
** does accept new unversioned content, it sends "uv-push-ok".
22562253
*/
22572254
if( blob_eq(&xfer.aToken[1], "uv-pull-only") ){
2258
- uvStatus = 1;
22592255
if( syncFlags & SYNC_UV_REVERT ) uvDoPush = 1;
22602256
}else if( blob_eq(&xfer.aToken[1], "uv-push-ok") ){
2261
- uvStatus = 2;
22622257
uvDoPush = 1;
22632258
}
22642259
}else
22652260
22662261
/* error MESSAGE
22672262
--- 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

Keyboard Shortcuts

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