Fossil SCM

The --project-code option on "fossil pull" implies --once.

drh 2020-02-07 12:44 trunk
Commit 6696d4de7d3107864715ea6a377e76feaae612a5d88f65277eb593a1701ecebe
1 file changed +9 -5
+9 -5
--- src/sync.c
+++ src/sync.c
@@ -126,11 +126,12 @@
126126
** most recently synced URL. Remember the current URL for next time.
127127
*/
128128
static void process_sync_args(
129129
unsigned *pConfigFlags, /* Write configuration flags here */
130130
unsigned *pSyncFlags, /* Write sync flags here */
131
- int uvOnly /* Special handling flags for UV sync */
131
+ int uvOnly, /* Special handling flags for UV sync */
132
+ unsigned urlOmitFlags /* Omit these URL flags */
132133
){
133134
const char *zUrl = 0;
134135
const char *zHttpAuth = 0;
135136
unsigned configSync = 0;
136137
unsigned urlFlags = URL_REMEMBER | URL_PROMPT_PW;
@@ -171,10 +172,11 @@
171172
if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL)
172173
&& db_get_boolean("uv-sync",0)
173174
){
174175
*pSyncFlags |= SYNC_UNVERSIONED;
175176
}
177
+ urlFlags &= ~urlOmitFlags;
176178
if( urlFlags & URL_REMEMBER ){
177179
clone_ssh_db_set_options();
178180
}
179181
url_parse(zUrl, urlFlags);
180182
remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl);
@@ -232,15 +234,17 @@
232234
** See also: clone, config pull, push, remote-url, sync
233235
*/
234236
void pull_cmd(void){
235237
unsigned configFlags = 0;
236238
unsigned syncFlags = SYNC_PULL;
239
+ unsigned urlOmitFlags = 0;
237240
const char *zAltPCode = find_option("project-code",0,1);
238241
if( find_option("from-parent-project",0,0)!=0 ){
239242
syncFlags |= SYNC_FROMPARENT;
240243
}
241
- process_sync_args(&configFlags, &syncFlags, 0);
244
+ if( zAltPCode ) urlOmitFlags = URL_REMEMBER;
245
+ process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags);
242246
243247
/* We should be done with options.. */
244248
verify_all_options();
245249
246250
client_sync(syncFlags, configFlags, 0, zAltPCode);
@@ -279,11 +283,11 @@
279283
** See also: clone, config push, pull, remote-url, sync
280284
*/
281285
void push_cmd(void){
282286
unsigned configFlags = 0;
283287
unsigned syncFlags = SYNC_PUSH;
284
- process_sync_args(&configFlags, &syncFlags, 0);
288
+ process_sync_args(&configFlags, &syncFlags, 0, 0);
285289
286290
/* We should be done with options.. */
287291
verify_all_options();
288292
289293
if( db_get_boolean("dont-push",0) ){
@@ -328,11 +332,11 @@
328332
unsigned configFlags = 0;
329333
unsigned syncFlags = SYNC_PUSH|SYNC_PULL;
330334
if( find_option("unversioned","u",0)!=0 ){
331335
syncFlags |= SYNC_UNVERSIONED;
332336
}
333
- process_sync_args(&configFlags, &syncFlags, 0);
337
+ process_sync_args(&configFlags, &syncFlags, 0, 0);
334338
335339
/* We should be done with options.. */
336340
verify_all_options();
337341
338342
if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH;
@@ -347,11 +351,11 @@
347351
** commands.
348352
*/
349353
void sync_unversioned(unsigned syncFlags){
350354
unsigned configFlags = 0;
351355
(void)find_option("uv-noop",0,0);
352
- process_sync_args(&configFlags, &syncFlags, 1);
356
+ process_sync_args(&configFlags, &syncFlags, 1, 0);
353357
verify_all_options();
354358
client_sync(syncFlags, 0, 0, 0);
355359
}
356360
357361
/*
358362
--- src/sync.c
+++ src/sync.c
@@ -126,11 +126,12 @@
126 ** most recently synced URL. Remember the current URL for next time.
127 */
128 static void process_sync_args(
129 unsigned *pConfigFlags, /* Write configuration flags here */
130 unsigned *pSyncFlags, /* Write sync flags here */
131 int uvOnly /* Special handling flags for UV sync */
 
132 ){
133 const char *zUrl = 0;
134 const char *zHttpAuth = 0;
135 unsigned configSync = 0;
136 unsigned urlFlags = URL_REMEMBER | URL_PROMPT_PW;
@@ -171,10 +172,11 @@
171 if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL)
172 && db_get_boolean("uv-sync",0)
173 ){
174 *pSyncFlags |= SYNC_UNVERSIONED;
175 }
 
176 if( urlFlags & URL_REMEMBER ){
177 clone_ssh_db_set_options();
178 }
179 url_parse(zUrl, urlFlags);
180 remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl);
@@ -232,15 +234,17 @@
232 ** See also: clone, config pull, push, remote-url, sync
233 */
234 void pull_cmd(void){
235 unsigned configFlags = 0;
236 unsigned syncFlags = SYNC_PULL;
 
237 const char *zAltPCode = find_option("project-code",0,1);
238 if( find_option("from-parent-project",0,0)!=0 ){
239 syncFlags |= SYNC_FROMPARENT;
240 }
241 process_sync_args(&configFlags, &syncFlags, 0);
 
242
243 /* We should be done with options.. */
244 verify_all_options();
245
246 client_sync(syncFlags, configFlags, 0, zAltPCode);
@@ -279,11 +283,11 @@
279 ** See also: clone, config push, pull, remote-url, sync
280 */
281 void push_cmd(void){
282 unsigned configFlags = 0;
283 unsigned syncFlags = SYNC_PUSH;
284 process_sync_args(&configFlags, &syncFlags, 0);
285
286 /* We should be done with options.. */
287 verify_all_options();
288
289 if( db_get_boolean("dont-push",0) ){
@@ -328,11 +332,11 @@
328 unsigned configFlags = 0;
329 unsigned syncFlags = SYNC_PUSH|SYNC_PULL;
330 if( find_option("unversioned","u",0)!=0 ){
331 syncFlags |= SYNC_UNVERSIONED;
332 }
333 process_sync_args(&configFlags, &syncFlags, 0);
334
335 /* We should be done with options.. */
336 verify_all_options();
337
338 if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH;
@@ -347,11 +351,11 @@
347 ** commands.
348 */
349 void sync_unversioned(unsigned syncFlags){
350 unsigned configFlags = 0;
351 (void)find_option("uv-noop",0,0);
352 process_sync_args(&configFlags, &syncFlags, 1);
353 verify_all_options();
354 client_sync(syncFlags, 0, 0, 0);
355 }
356
357 /*
358
--- src/sync.c
+++ src/sync.c
@@ -126,11 +126,12 @@
126 ** most recently synced URL. Remember the current URL for next time.
127 */
128 static void process_sync_args(
129 unsigned *pConfigFlags, /* Write configuration flags here */
130 unsigned *pSyncFlags, /* Write sync flags here */
131 int uvOnly, /* Special handling flags for UV sync */
132 unsigned urlOmitFlags /* Omit these URL flags */
133 ){
134 const char *zUrl = 0;
135 const char *zHttpAuth = 0;
136 unsigned configSync = 0;
137 unsigned urlFlags = URL_REMEMBER | URL_PROMPT_PW;
@@ -171,10 +172,11 @@
172 if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL)
173 && db_get_boolean("uv-sync",0)
174 ){
175 *pSyncFlags |= SYNC_UNVERSIONED;
176 }
177 urlFlags &= ~urlOmitFlags;
178 if( urlFlags & URL_REMEMBER ){
179 clone_ssh_db_set_options();
180 }
181 url_parse(zUrl, urlFlags);
182 remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl);
@@ -232,15 +234,17 @@
234 ** See also: clone, config pull, push, remote-url, sync
235 */
236 void pull_cmd(void){
237 unsigned configFlags = 0;
238 unsigned syncFlags = SYNC_PULL;
239 unsigned urlOmitFlags = 0;
240 const char *zAltPCode = find_option("project-code",0,1);
241 if( find_option("from-parent-project",0,0)!=0 ){
242 syncFlags |= SYNC_FROMPARENT;
243 }
244 if( zAltPCode ) urlOmitFlags = URL_REMEMBER;
245 process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags);
246
247 /* We should be done with options.. */
248 verify_all_options();
249
250 client_sync(syncFlags, configFlags, 0, zAltPCode);
@@ -279,11 +283,11 @@
283 ** See also: clone, config push, pull, remote-url, sync
284 */
285 void push_cmd(void){
286 unsigned configFlags = 0;
287 unsigned syncFlags = SYNC_PUSH;
288 process_sync_args(&configFlags, &syncFlags, 0, 0);
289
290 /* We should be done with options.. */
291 verify_all_options();
292
293 if( db_get_boolean("dont-push",0) ){
@@ -328,11 +332,11 @@
332 unsigned configFlags = 0;
333 unsigned syncFlags = SYNC_PUSH|SYNC_PULL;
334 if( find_option("unversioned","u",0)!=0 ){
335 syncFlags |= SYNC_UNVERSIONED;
336 }
337 process_sync_args(&configFlags, &syncFlags, 0, 0);
338
339 /* We should be done with options.. */
340 verify_all_options();
341
342 if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH;
@@ -347,11 +351,11 @@
351 ** commands.
352 */
353 void sync_unversioned(unsigned syncFlags){
354 unsigned configFlags = 0;
355 (void)find_option("uv-noop",0,0);
356 process_sync_args(&configFlags, &syncFlags, 1, 0);
357 verify_all_options();
358 client_sync(syncFlags, 0, 0, 0);
359 }
360
361 /*
362

Keyboard Shortcuts

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