Fossil SCM

Fix the "fossil rebuild" command so that it no longer trashes the unversioned content. Add the -u option to "fossil clone" to retrieve unversioned content during the clone.

drh 2016-08-18 12:33 trunk
Commit a5d8548f61512c4cba76af5aa31c25d96bf40485
3 files changed +4 -2 +1 -1 +6 -4
+4 -2
--- src/clone.c
+++ src/clone.c
@@ -114,11 +114,12 @@
114114
** --once Don't remember the URI.
115115
** --private Also clone private branches
116116
** --ssl-identity FILENAME Use the SSL identity if requested by the server
117117
** --ssh-command|-c SSH Use SSH as the "ssh" command
118118
** --httpauth|-B USER:PASS Add HTTP Basic Authorization to requests
119
-** --verbose Show more statistics in output
119
+** -u|--unversioned Also sync unversioned content
120
+** -v|--verbose Show more statistics in output
120121
**
121122
** See also: init
122123
*/
123124
void clone_cmd(void){
124125
char *zPassword;
@@ -129,11 +130,12 @@
129130
int syncFlags = SYNC_CLONE;
130131
131132
/* Also clone private branches */
132133
if( find_option("private",0,0)!=0 ) syncFlags |= SYNC_PRIVATE;
133134
if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER;
134
- if( find_option("verbose",0,0)!=0) syncFlags |= SYNC_VERBOSE;
135
+ if( find_option("verbose","v",0)!=0) syncFlags |= SYNC_VERBOSE;
136
+ if( find_option("unversioned","u",0)!=0 ) syncFlags |= SYNC_UNVERSIONED;
135137
zHttpAuth = find_option("httpauth","B",1);
136138
zDefaultUser = find_option("admin-user","A",1);
137139
clone_ssh_find_options();
138140
url_proxy_options();
139141
140142
--- src/clone.c
+++ src/clone.c
@@ -114,11 +114,12 @@
114 ** --once Don't remember the URI.
115 ** --private Also clone private branches
116 ** --ssl-identity FILENAME Use the SSL identity if requested by the server
117 ** --ssh-command|-c SSH Use SSH as the "ssh" command
118 ** --httpauth|-B USER:PASS Add HTTP Basic Authorization to requests
119 ** --verbose Show more statistics in output
 
120 **
121 ** See also: init
122 */
123 void clone_cmd(void){
124 char *zPassword;
@@ -129,11 +130,12 @@
129 int syncFlags = SYNC_CLONE;
130
131 /* Also clone private branches */
132 if( find_option("private",0,0)!=0 ) syncFlags |= SYNC_PRIVATE;
133 if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER;
134 if( find_option("verbose",0,0)!=0) syncFlags |= SYNC_VERBOSE;
 
135 zHttpAuth = find_option("httpauth","B",1);
136 zDefaultUser = find_option("admin-user","A",1);
137 clone_ssh_find_options();
138 url_proxy_options();
139
140
--- src/clone.c
+++ src/clone.c
@@ -114,11 +114,12 @@
114 ** --once Don't remember the URI.
115 ** --private Also clone private branches
116 ** --ssl-identity FILENAME Use the SSL identity if requested by the server
117 ** --ssh-command|-c SSH Use SSH as the "ssh" command
118 ** --httpauth|-B USER:PASS Add HTTP Basic Authorization to requests
119 ** -u|--unversioned Also sync unversioned content
120 ** -v|--verbose Show more statistics in output
121 **
122 ** See also: init
123 */
124 void clone_cmd(void){
125 char *zPassword;
@@ -129,11 +130,12 @@
130 int syncFlags = SYNC_CLONE;
131
132 /* Also clone private branches */
133 if( find_option("private",0,0)!=0 ) syncFlags |= SYNC_PRIVATE;
134 if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER;
135 if( find_option("verbose","v",0)!=0) syncFlags |= SYNC_VERBOSE;
136 if( find_option("unversioned","u",0)!=0 ) syncFlags |= SYNC_UNVERSIONED;
137 zHttpAuth = find_option("httpauth","B",1);
138 zDefaultUser = find_option("admin-user","A",1);
139 clone_ssh_find_options();
140 url_proxy_options();
141
142
+1 -1
--- src/rebuild.c
+++ src/rebuild.c
@@ -349,11 +349,11 @@
349349
"SELECT name FROM sqlite_master /*scan*/"
350350
" WHERE type='table'"
351351
" AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user',"
352352
"'config','shun','private','reportfmt',"
353353
"'concealed','accesslog','modreq',"
354
- "'purgeevent','purgeitem')"
354
+ "'purgeevent','purgeitem','unversioned')"
355355
" AND name NOT GLOB 'sqlite_*'"
356356
" AND name NOT GLOB 'fx_*'"
357357
);
358358
if( zTable==0 ) break;
359359
db_multi_exec("DROP TABLE %Q", zTable);
360360
--- src/rebuild.c
+++ src/rebuild.c
@@ -349,11 +349,11 @@
349 "SELECT name FROM sqlite_master /*scan*/"
350 " WHERE type='table'"
351 " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user',"
352 "'config','shun','private','reportfmt',"
353 "'concealed','accesslog','modreq',"
354 "'purgeevent','purgeitem')"
355 " AND name NOT GLOB 'sqlite_*'"
356 " AND name NOT GLOB 'fx_*'"
357 );
358 if( zTable==0 ) break;
359 db_multi_exec("DROP TABLE %Q", zTable);
360
--- src/rebuild.c
+++ src/rebuild.c
@@ -349,11 +349,11 @@
349 "SELECT name FROM sqlite_master /*scan*/"
350 " WHERE type='table'"
351 " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user',"
352 "'config','shun','private','reportfmt',"
353 "'concealed','accesslog','modreq',"
354 "'purgeevent','purgeitem','unversioned')"
355 " AND name NOT GLOB 'sqlite_*'"
356 " AND name NOT GLOB 'fx_*'"
357 );
358 if( zTable==0 ) break;
359 db_multi_exec("DROP TABLE %Q", zTable);
360
+6 -4
--- src/xfer.c
+++ src/xfer.c
@@ -1751,10 +1751,11 @@
17511751
17521752
/* When syncing unversioned files, create a TEMP table in which to store
17531753
** the names of files that do not need to be sent from client to server.
17541754
*/
17551755
if( (syncFlags & SYNC_UNVERSIONED)!=0 ){
1756
+ unversioned_schema();
17561757
db_multi_exec(
17571758
"CREATE TEMP TABLE uv_tosend("
17581759
" name TEXT PRIMARY KEY,"
17591760
" mtimeOnly BOOLEAN"
17601761
") WITHOUT ROWID;"
@@ -2357,23 +2358,24 @@
23572358
*/
23582359
if( xfer.nFileSent+xfer.nDeltaSent>0 || uvDoPush ){
23592360
go = 1;
23602361
}
23612362
2362
- /* Continue looping as long as new uvfile cards are being received
2363
- ** and uvgimme cards are being sent. */
2364
- if( nUvGimmeSent>0 && nUvFileRcvd>0 ) go = 1;
2365
-
23662363
/* If this is a clone, the go at least two rounds */
23672364
if( (syncFlags & SYNC_CLONE)!=0 && nCycle==1 ) go = 1;
23682365
23692366
/* Stop the cycle if the server sends a "clone_seqno 0" card and
23702367
** we have gone at least two rounds. Always go at least two rounds
23712368
** on a clone in order to be sure to retrieve the configuration
23722369
** information which is only sent on the second round.
23732370
*/
23742371
if( cloneSeqno<=0 && nCycle>1 ) go = 0;
2372
+
2373
+ /* Continue looping as long as new uvfile cards are being received
2374
+ ** and uvgimme cards are being sent. */
2375
+ if( nUvGimmeSent>0 && nUvFileRcvd>0 ) go = 1;
2376
+
23752377
db_multi_exec("DROP TABLE onremote");
23762378
if( go ){
23772379
manifest_crosslink_end(MC_PERMIT_HOOKS);
23782380
}else{
23792381
manifest_crosslink_end(MC_PERMIT_HOOKS);
23802382
--- src/xfer.c
+++ src/xfer.c
@@ -1751,10 +1751,11 @@
1751
1752 /* When syncing unversioned files, create a TEMP table in which to store
1753 ** the names of files that do not need to be sent from client to server.
1754 */
1755 if( (syncFlags & SYNC_UNVERSIONED)!=0 ){
 
1756 db_multi_exec(
1757 "CREATE TEMP TABLE uv_tosend("
1758 " name TEXT PRIMARY KEY,"
1759 " mtimeOnly BOOLEAN"
1760 ") WITHOUT ROWID;"
@@ -2357,23 +2358,24 @@
2357 */
2358 if( xfer.nFileSent+xfer.nDeltaSent>0 || uvDoPush ){
2359 go = 1;
2360 }
2361
2362 /* Continue looping as long as new uvfile cards are being received
2363 ** and uvgimme cards are being sent. */
2364 if( nUvGimmeSent>0 && nUvFileRcvd>0 ) go = 1;
2365
2366 /* If this is a clone, the go at least two rounds */
2367 if( (syncFlags & SYNC_CLONE)!=0 && nCycle==1 ) go = 1;
2368
2369 /* Stop the cycle if the server sends a "clone_seqno 0" card and
2370 ** we have gone at least two rounds. Always go at least two rounds
2371 ** on a clone in order to be sure to retrieve the configuration
2372 ** information which is only sent on the second round.
2373 */
2374 if( cloneSeqno<=0 && nCycle>1 ) go = 0;
 
 
 
 
 
2375 db_multi_exec("DROP TABLE onremote");
2376 if( go ){
2377 manifest_crosslink_end(MC_PERMIT_HOOKS);
2378 }else{
2379 manifest_crosslink_end(MC_PERMIT_HOOKS);
2380
--- src/xfer.c
+++ src/xfer.c
@@ -1751,10 +1751,11 @@
1751
1752 /* When syncing unversioned files, create a TEMP table in which to store
1753 ** the names of files that do not need to be sent from client to server.
1754 */
1755 if( (syncFlags & SYNC_UNVERSIONED)!=0 ){
1756 unversioned_schema();
1757 db_multi_exec(
1758 "CREATE TEMP TABLE uv_tosend("
1759 " name TEXT PRIMARY KEY,"
1760 " mtimeOnly BOOLEAN"
1761 ") WITHOUT ROWID;"
@@ -2357,23 +2358,24 @@
2358 */
2359 if( xfer.nFileSent+xfer.nDeltaSent>0 || uvDoPush ){
2360 go = 1;
2361 }
2362
 
 
 
 
2363 /* If this is a clone, the go at least two rounds */
2364 if( (syncFlags & SYNC_CLONE)!=0 && nCycle==1 ) go = 1;
2365
2366 /* Stop the cycle if the server sends a "clone_seqno 0" card and
2367 ** we have gone at least two rounds. Always go at least two rounds
2368 ** on a clone in order to be sure to retrieve the configuration
2369 ** information which is only sent on the second round.
2370 */
2371 if( cloneSeqno<=0 && nCycle>1 ) go = 0;
2372
2373 /* Continue looping as long as new uvfile cards are being received
2374 ** and uvgimme cards are being sent. */
2375 if( nUvGimmeSent>0 && nUvFileRcvd>0 ) go = 1;
2376
2377 db_multi_exec("DROP TABLE onremote");
2378 if( go ){
2379 manifest_crosslink_end(MC_PERMIT_HOOKS);
2380 }else{
2381 manifest_crosslink_end(MC_PERMIT_HOOKS);
2382

Keyboard Shortcuts

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