Fossil SCM
The --project-code option on "fossil pull" implies --once.
Commit
6696d4de7d3107864715ea6a377e76feaae612a5d88f65277eb593a1701ecebe
Parent
be9df83b420a3f8…
1 file changed
+9
-5
+9
-5
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -126,11 +126,12 @@ | ||
| 126 | 126 | ** most recently synced URL. Remember the current URL for next time. |
| 127 | 127 | */ |
| 128 | 128 | static void process_sync_args( |
| 129 | 129 | unsigned *pConfigFlags, /* Write configuration flags here */ |
| 130 | 130 | 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 */ | |
| 132 | 133 | ){ |
| 133 | 134 | const char *zUrl = 0; |
| 134 | 135 | const char *zHttpAuth = 0; |
| 135 | 136 | unsigned configSync = 0; |
| 136 | 137 | unsigned urlFlags = URL_REMEMBER | URL_PROMPT_PW; |
| @@ -171,10 +172,11 @@ | ||
| 171 | 172 | if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) |
| 172 | 173 | && db_get_boolean("uv-sync",0) |
| 173 | 174 | ){ |
| 174 | 175 | *pSyncFlags |= SYNC_UNVERSIONED; |
| 175 | 176 | } |
| 177 | + urlFlags &= ~urlOmitFlags; | |
| 176 | 178 | if( urlFlags & URL_REMEMBER ){ |
| 177 | 179 | clone_ssh_db_set_options(); |
| 178 | 180 | } |
| 179 | 181 | url_parse(zUrl, urlFlags); |
| 180 | 182 | remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl); |
| @@ -232,15 +234,17 @@ | ||
| 232 | 234 | ** See also: clone, config pull, push, remote-url, sync |
| 233 | 235 | */ |
| 234 | 236 | void pull_cmd(void){ |
| 235 | 237 | unsigned configFlags = 0; |
| 236 | 238 | unsigned syncFlags = SYNC_PULL; |
| 239 | + unsigned urlOmitFlags = 0; | |
| 237 | 240 | const char *zAltPCode = find_option("project-code",0,1); |
| 238 | 241 | if( find_option("from-parent-project",0,0)!=0 ){ |
| 239 | 242 | syncFlags |= SYNC_FROMPARENT; |
| 240 | 243 | } |
| 241 | - process_sync_args(&configFlags, &syncFlags, 0); | |
| 244 | + if( zAltPCode ) urlOmitFlags = URL_REMEMBER; | |
| 245 | + process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags); | |
| 242 | 246 | |
| 243 | 247 | /* We should be done with options.. */ |
| 244 | 248 | verify_all_options(); |
| 245 | 249 | |
| 246 | 250 | client_sync(syncFlags, configFlags, 0, zAltPCode); |
| @@ -279,11 +283,11 @@ | ||
| 279 | 283 | ** See also: clone, config push, pull, remote-url, sync |
| 280 | 284 | */ |
| 281 | 285 | void push_cmd(void){ |
| 282 | 286 | unsigned configFlags = 0; |
| 283 | 287 | unsigned syncFlags = SYNC_PUSH; |
| 284 | - process_sync_args(&configFlags, &syncFlags, 0); | |
| 288 | + process_sync_args(&configFlags, &syncFlags, 0, 0); | |
| 285 | 289 | |
| 286 | 290 | /* We should be done with options.. */ |
| 287 | 291 | verify_all_options(); |
| 288 | 292 | |
| 289 | 293 | if( db_get_boolean("dont-push",0) ){ |
| @@ -328,11 +332,11 @@ | ||
| 328 | 332 | unsigned configFlags = 0; |
| 329 | 333 | unsigned syncFlags = SYNC_PUSH|SYNC_PULL; |
| 330 | 334 | if( find_option("unversioned","u",0)!=0 ){ |
| 331 | 335 | syncFlags |= SYNC_UNVERSIONED; |
| 332 | 336 | } |
| 333 | - process_sync_args(&configFlags, &syncFlags, 0); | |
| 337 | + process_sync_args(&configFlags, &syncFlags, 0, 0); | |
| 334 | 338 | |
| 335 | 339 | /* We should be done with options.. */ |
| 336 | 340 | verify_all_options(); |
| 337 | 341 | |
| 338 | 342 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| @@ -347,11 +351,11 @@ | ||
| 347 | 351 | ** commands. |
| 348 | 352 | */ |
| 349 | 353 | void sync_unversioned(unsigned syncFlags){ |
| 350 | 354 | unsigned configFlags = 0; |
| 351 | 355 | (void)find_option("uv-noop",0,0); |
| 352 | - process_sync_args(&configFlags, &syncFlags, 1); | |
| 356 | + process_sync_args(&configFlags, &syncFlags, 1, 0); | |
| 353 | 357 | verify_all_options(); |
| 354 | 358 | client_sync(syncFlags, 0, 0, 0); |
| 355 | 359 | } |
| 356 | 360 | |
| 357 | 361 | /* |
| 358 | 362 |
| --- 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 |