Fossil SCM
Add the --all option to "fossil sync" and similar, causing the sync to occur against all remote repositories shown in "fossil remote list".
Commit
6b4a04d4494faae2ad66bb54d85616b058000f43500a1122b25da508a04e8992
Parent
5623188de389363…
2 files changed
+76
-12
+1
+76
-12
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -18,10 +18,72 @@ | ||
| 18 | 18 | ** This file contains code used to push, pull, and sync a repository |
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "sync.h" |
| 22 | 22 | #include <assert.h> |
| 23 | + | |
| 24 | +/* | |
| 25 | +** Explain what type of sync operation is about to occur | |
| 26 | +*/ | |
| 27 | +static void sync_explain(unsigned syncFlags){ | |
| 28 | + if( g.url.isAlias ){ | |
| 29 | + if( (syncFlags & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){ | |
| 30 | + fossil_print("Sync with %s\n", g.url.canonical); | |
| 31 | + }else if( syncFlags & SYNC_PUSH ){ | |
| 32 | + fossil_print("Push to %s\n", g.url.canonical); | |
| 33 | + }else if( syncFlags & SYNC_PULL ){ | |
| 34 | + fossil_print("Pull from %s\n", g.url.canonical); | |
| 35 | + } | |
| 36 | + } | |
| 37 | +} | |
| 38 | + | |
| 39 | + | |
| 40 | +/* | |
| 41 | +** Call client_sync() one or more times in order to complete a | |
| 42 | +** sync operation. Usually, client_sync() is called only once, though | |
| 43 | +** is can be called multiple times if the SYNC_ALLURL flags is set. | |
| 44 | +*/ | |
| 45 | +static int client_sync_all_urls( | |
| 46 | + unsigned syncFlags, /* Mask of SYNC_* flags */ | |
| 47 | + unsigned configRcvMask, /* Receive these configuration items */ | |
| 48 | + unsigned configSendMask, /* Send these configuration items */ | |
| 49 | + const char *zAltPCode /* Alternative project code (usually NULL) */ | |
| 50 | +){ | |
| 51 | + int nErr; | |
| 52 | + int nOther; | |
| 53 | + char **azOther; | |
| 54 | + int i; | |
| 55 | + Stmt q; | |
| 56 | + | |
| 57 | + sync_explain(syncFlags); | |
| 58 | + nErr = client_sync(syncFlags, configRcvMask, configSendMask, zAltPCode); | |
| 59 | + if( (syncFlags & SYNC_ALLURL)==0 ) return nErr; | |
| 60 | + nOther = 0; | |
| 61 | + azOther = 0; | |
| 62 | + db_prepare(&q, | |
| 63 | + "SELECT substr(name,10) FROM config" | |
| 64 | + " WHERE name glob 'sync-url:*'" | |
| 65 | + " AND value<>(SELECT value FROM config WHERE name='last-sync-url')" | |
| 66 | + ); | |
| 67 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 68 | + const char *zUrl = db_column_text(&q, 0); | |
| 69 | + azOther = fossil_realloc(azOther, sizeof(*azOther)*(nOther+1)); | |
| 70 | + azOther[nOther++] = fossil_strdup(zUrl); | |
| 71 | + } | |
| 72 | + db_finalize(&q); | |
| 73 | + for(i=0; i<nOther; i++){ | |
| 74 | + url_unparse(&g.url); | |
| 75 | + url_parse(azOther[i], URL_PROMPT_PW); | |
| 76 | + sync_explain(syncFlags); | |
| 77 | + nErr += client_sync(syncFlags, configRcvMask, configSendMask, zAltPCode); | |
| 78 | + fossil_free(azOther[i]); | |
| 79 | + azOther[i] = 0; | |
| 80 | + } | |
| 81 | + fossil_free(azOther); | |
| 82 | + return nErr; | |
| 83 | +} | |
| 84 | + | |
| 23 | 85 | |
| 24 | 86 | /* |
| 25 | 87 | ** If the repository is configured for autosyncing, then do an |
| 26 | 88 | ** autosync. Bits of the "flags" parameter determine details of behavior: |
| 27 | 89 | ** |
| @@ -149,18 +211,25 @@ | ||
| 149 | 211 | *pSyncFlags |= SYNC_VERBOSE; |
| 150 | 212 | } |
| 151 | 213 | if( find_option("no-http-compression",0,0)!=0 ){ |
| 152 | 214 | *pSyncFlags |= SYNC_NOHTTPCOMPRESS; |
| 153 | 215 | } |
| 216 | + if( find_option("all",0,0)!=0 ){ | |
| 217 | + *pSyncFlags |= SYNC_ALLURL; | |
| 218 | + } | |
| 154 | 219 | url_proxy_options(); |
| 155 | 220 | clone_ssh_find_options(); |
| 156 | 221 | if( !uvOnly ) db_find_and_open_repository(0, 0); |
| 157 | 222 | db_open_config(0, 1); |
| 158 | 223 | if( g.argc==2 ){ |
| 159 | 224 | if( db_get_boolean("auto-shun",0) ) configSync = CONFIGSET_SHUN; |
| 160 | 225 | }else if( g.argc==3 ){ |
| 161 | 226 | zUrl = g.argv[2]; |
| 227 | + if( (*pSyncFlags) & SYNC_ALLURL ){ | |
| 228 | + fossil_fatal("cannot use both the --all option and specific URL \"%s\"", | |
| 229 | + zUrl); | |
| 230 | + } | |
| 162 | 231 | } |
| 163 | 232 | if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) |
| 164 | 233 | && db_get_boolean("uv-sync",0) |
| 165 | 234 | ){ |
| 166 | 235 | *pSyncFlags |= SYNC_UNVERSIONED; |
| @@ -175,22 +244,14 @@ | ||
| 175 | 244 | if( g.url.protocol==0 ){ |
| 176 | 245 | if( urlOptional ) fossil_exit(0); |
| 177 | 246 | usage("URL"); |
| 178 | 247 | } |
| 179 | 248 | user_select(); |
| 180 | - if( g.url.isAlias ){ | |
| 181 | - if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){ | |
| 182 | - fossil_print("Sync with %s\n", g.url.canonical); | |
| 183 | - }else if( (*pSyncFlags) & SYNC_PUSH ){ | |
| 184 | - fossil_print("Push to %s\n", g.url.canonical); | |
| 185 | - }else if( (*pSyncFlags) & SYNC_PULL ){ | |
| 186 | - fossil_print("Pull from %s\n", g.url.canonical); | |
| 187 | - } | |
| 188 | - } | |
| 189 | 249 | url_enable_proxy("via proxy: "); |
| 190 | 250 | *pConfigFlags |= configSync; |
| 191 | 251 | } |
| 252 | + | |
| 192 | 253 | |
| 193 | 254 | /* |
| 194 | 255 | ** COMMAND: pull |
| 195 | 256 | ** |
| 196 | 257 | ** Usage: %fossil pull ?URL? ?options? |
| @@ -205,10 +266,11 @@ | ||
| 205 | 266 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 206 | 267 | ** details on the URL formats. |
| 207 | 268 | ** |
| 208 | 269 | ** Options: |
| 209 | 270 | ** |
| 271 | +** --all Pull from all remotes, not just the default | |
| 210 | 272 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 211 | 273 | ** if required by the remote website |
| 212 | 274 | ** --from-parent-project Pull content from the parent project |
| 213 | 275 | ** --ipv4 Use only IPv4, not IPv6 |
| 214 | 276 | ** --no-http-compression Do not compress HTTP traffic |
| @@ -237,11 +299,11 @@ | ||
| 237 | 299 | process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags); |
| 238 | 300 | |
| 239 | 301 | /* We should be done with options.. */ |
| 240 | 302 | verify_all_options(); |
| 241 | 303 | |
| 242 | - client_sync(syncFlags, configFlags, 0, zAltPCode); | |
| 304 | + client_sync_all_urls(syncFlags, configFlags, 0, zAltPCode); | |
| 243 | 305 | } |
| 244 | 306 | |
| 245 | 307 | /* |
| 246 | 308 | ** COMMAND: push |
| 247 | 309 | ** |
| @@ -257,10 +319,11 @@ | ||
| 257 | 319 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 258 | 320 | ** details on the URL formats. |
| 259 | 321 | ** |
| 260 | 322 | ** Options: |
| 261 | 323 | ** |
| 324 | +** --all Push to all remotes, not just the default | |
| 262 | 325 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 263 | 326 | ** if required by the remote website |
| 264 | 327 | ** --ipv4 Use only IPv4, not IPv6 |
| 265 | 328 | ** --no-http-compression Do not compress HTTP traffic |
| 266 | 329 | ** --once Do not remember URL for subsequent syncs |
| @@ -284,11 +347,11 @@ | ||
| 284 | 347 | verify_all_options(); |
| 285 | 348 | |
| 286 | 349 | if( db_get_boolean("dont-push",0) ){ |
| 287 | 350 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 288 | 351 | } |
| 289 | - client_sync(syncFlags, 0, 0, 0); | |
| 352 | + client_sync_all_urls(syncFlags, 0, 0, 0); | |
| 290 | 353 | } |
| 291 | 354 | |
| 292 | 355 | |
| 293 | 356 | /* |
| 294 | 357 | ** COMMAND: sync |
| @@ -303,10 +366,11 @@ | ||
| 303 | 366 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 304 | 367 | ** details on the URL formats. |
| 305 | 368 | ** |
| 306 | 369 | ** Options: |
| 307 | 370 | ** |
| 371 | +** --all Sync with all remotes, not just the default | |
| 308 | 372 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 309 | 373 | ** if required by the remote website |
| 310 | 374 | ** --ipv4 Use only IPv4, not IPv6 |
| 311 | 375 | ** --no-http-compression Do not compress HTTP traffic |
| 312 | 376 | ** --once Do not remember URL for subsequent syncs |
| @@ -332,14 +396,14 @@ | ||
| 332 | 396 | |
| 333 | 397 | /* We should be done with options.. */ |
| 334 | 398 | verify_all_options(); |
| 335 | 399 | |
| 336 | 400 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 337 | - client_sync(syncFlags, configFlags, 0, 0); | |
| 338 | 401 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 339 | 402 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 340 | 403 | } |
| 404 | + client_sync_all_urls(syncFlags, configFlags, 0, 0); | |
| 341 | 405 | } |
| 342 | 406 | |
| 343 | 407 | /* |
| 344 | 408 | ** Handle the "fossil unversioned sync" and "fossil unversioned revert" |
| 345 | 409 | ** commands. |
| 346 | 410 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -18,10 +18,72 @@ | |
| 18 | ** This file contains code used to push, pull, and sync a repository |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "sync.h" |
| 22 | #include <assert.h> |
| 23 | |
| 24 | /* |
| 25 | ** If the repository is configured for autosyncing, then do an |
| 26 | ** autosync. Bits of the "flags" parameter determine details of behavior: |
| 27 | ** |
| @@ -149,18 +211,25 @@ | |
| 149 | *pSyncFlags |= SYNC_VERBOSE; |
| 150 | } |
| 151 | if( find_option("no-http-compression",0,0)!=0 ){ |
| 152 | *pSyncFlags |= SYNC_NOHTTPCOMPRESS; |
| 153 | } |
| 154 | url_proxy_options(); |
| 155 | clone_ssh_find_options(); |
| 156 | if( !uvOnly ) db_find_and_open_repository(0, 0); |
| 157 | db_open_config(0, 1); |
| 158 | if( g.argc==2 ){ |
| 159 | if( db_get_boolean("auto-shun",0) ) configSync = CONFIGSET_SHUN; |
| 160 | }else if( g.argc==3 ){ |
| 161 | zUrl = g.argv[2]; |
| 162 | } |
| 163 | if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) |
| 164 | && db_get_boolean("uv-sync",0) |
| 165 | ){ |
| 166 | *pSyncFlags |= SYNC_UNVERSIONED; |
| @@ -175,22 +244,14 @@ | |
| 175 | if( g.url.protocol==0 ){ |
| 176 | if( urlOptional ) fossil_exit(0); |
| 177 | usage("URL"); |
| 178 | } |
| 179 | user_select(); |
| 180 | if( g.url.isAlias ){ |
| 181 | if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){ |
| 182 | fossil_print("Sync with %s\n", g.url.canonical); |
| 183 | }else if( (*pSyncFlags) & SYNC_PUSH ){ |
| 184 | fossil_print("Push to %s\n", g.url.canonical); |
| 185 | }else if( (*pSyncFlags) & SYNC_PULL ){ |
| 186 | fossil_print("Pull from %s\n", g.url.canonical); |
| 187 | } |
| 188 | } |
| 189 | url_enable_proxy("via proxy: "); |
| 190 | *pConfigFlags |= configSync; |
| 191 | } |
| 192 | |
| 193 | /* |
| 194 | ** COMMAND: pull |
| 195 | ** |
| 196 | ** Usage: %fossil pull ?URL? ?options? |
| @@ -205,10 +266,11 @@ | |
| 205 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 206 | ** details on the URL formats. |
| 207 | ** |
| 208 | ** Options: |
| 209 | ** |
| 210 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 211 | ** if required by the remote website |
| 212 | ** --from-parent-project Pull content from the parent project |
| 213 | ** --ipv4 Use only IPv4, not IPv6 |
| 214 | ** --no-http-compression Do not compress HTTP traffic |
| @@ -237,11 +299,11 @@ | |
| 237 | process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags); |
| 238 | |
| 239 | /* We should be done with options.. */ |
| 240 | verify_all_options(); |
| 241 | |
| 242 | client_sync(syncFlags, configFlags, 0, zAltPCode); |
| 243 | } |
| 244 | |
| 245 | /* |
| 246 | ** COMMAND: push |
| 247 | ** |
| @@ -257,10 +319,11 @@ | |
| 257 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 258 | ** details on the URL formats. |
| 259 | ** |
| 260 | ** Options: |
| 261 | ** |
| 262 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 263 | ** if required by the remote website |
| 264 | ** --ipv4 Use only IPv4, not IPv6 |
| 265 | ** --no-http-compression Do not compress HTTP traffic |
| 266 | ** --once Do not remember URL for subsequent syncs |
| @@ -284,11 +347,11 @@ | |
| 284 | verify_all_options(); |
| 285 | |
| 286 | if( db_get_boolean("dont-push",0) ){ |
| 287 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 288 | } |
| 289 | client_sync(syncFlags, 0, 0, 0); |
| 290 | } |
| 291 | |
| 292 | |
| 293 | /* |
| 294 | ** COMMAND: sync |
| @@ -303,10 +366,11 @@ | |
| 303 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 304 | ** details on the URL formats. |
| 305 | ** |
| 306 | ** Options: |
| 307 | ** |
| 308 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 309 | ** if required by the remote website |
| 310 | ** --ipv4 Use only IPv4, not IPv6 |
| 311 | ** --no-http-compression Do not compress HTTP traffic |
| 312 | ** --once Do not remember URL for subsequent syncs |
| @@ -332,14 +396,14 @@ | |
| 332 | |
| 333 | /* We should be done with options.. */ |
| 334 | verify_all_options(); |
| 335 | |
| 336 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 337 | client_sync(syncFlags, configFlags, 0, 0); |
| 338 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 339 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | /* |
| 344 | ** Handle the "fossil unversioned sync" and "fossil unversioned revert" |
| 345 | ** commands. |
| 346 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -18,10 +18,72 @@ | |
| 18 | ** This file contains code used to push, pull, and sync a repository |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "sync.h" |
| 22 | #include <assert.h> |
| 23 | |
| 24 | /* |
| 25 | ** Explain what type of sync operation is about to occur |
| 26 | */ |
| 27 | static void sync_explain(unsigned syncFlags){ |
| 28 | if( g.url.isAlias ){ |
| 29 | if( (syncFlags & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){ |
| 30 | fossil_print("Sync with %s\n", g.url.canonical); |
| 31 | }else if( syncFlags & SYNC_PUSH ){ |
| 32 | fossil_print("Push to %s\n", g.url.canonical); |
| 33 | }else if( syncFlags & SYNC_PULL ){ |
| 34 | fossil_print("Pull from %s\n", g.url.canonical); |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | |
| 40 | /* |
| 41 | ** Call client_sync() one or more times in order to complete a |
| 42 | ** sync operation. Usually, client_sync() is called only once, though |
| 43 | ** is can be called multiple times if the SYNC_ALLURL flags is set. |
| 44 | */ |
| 45 | static int client_sync_all_urls( |
| 46 | unsigned syncFlags, /* Mask of SYNC_* flags */ |
| 47 | unsigned configRcvMask, /* Receive these configuration items */ |
| 48 | unsigned configSendMask, /* Send these configuration items */ |
| 49 | const char *zAltPCode /* Alternative project code (usually NULL) */ |
| 50 | ){ |
| 51 | int nErr; |
| 52 | int nOther; |
| 53 | char **azOther; |
| 54 | int i; |
| 55 | Stmt q; |
| 56 | |
| 57 | sync_explain(syncFlags); |
| 58 | nErr = client_sync(syncFlags, configRcvMask, configSendMask, zAltPCode); |
| 59 | if( (syncFlags & SYNC_ALLURL)==0 ) return nErr; |
| 60 | nOther = 0; |
| 61 | azOther = 0; |
| 62 | db_prepare(&q, |
| 63 | "SELECT substr(name,10) FROM config" |
| 64 | " WHERE name glob 'sync-url:*'" |
| 65 | " AND value<>(SELECT value FROM config WHERE name='last-sync-url')" |
| 66 | ); |
| 67 | while( db_step(&q)==SQLITE_ROW ){ |
| 68 | const char *zUrl = db_column_text(&q, 0); |
| 69 | azOther = fossil_realloc(azOther, sizeof(*azOther)*(nOther+1)); |
| 70 | azOther[nOther++] = fossil_strdup(zUrl); |
| 71 | } |
| 72 | db_finalize(&q); |
| 73 | for(i=0; i<nOther; i++){ |
| 74 | url_unparse(&g.url); |
| 75 | url_parse(azOther[i], URL_PROMPT_PW); |
| 76 | sync_explain(syncFlags); |
| 77 | nErr += client_sync(syncFlags, configRcvMask, configSendMask, zAltPCode); |
| 78 | fossil_free(azOther[i]); |
| 79 | azOther[i] = 0; |
| 80 | } |
| 81 | fossil_free(azOther); |
| 82 | return nErr; |
| 83 | } |
| 84 | |
| 85 | |
| 86 | /* |
| 87 | ** If the repository is configured for autosyncing, then do an |
| 88 | ** autosync. Bits of the "flags" parameter determine details of behavior: |
| 89 | ** |
| @@ -149,18 +211,25 @@ | |
| 211 | *pSyncFlags |= SYNC_VERBOSE; |
| 212 | } |
| 213 | if( find_option("no-http-compression",0,0)!=0 ){ |
| 214 | *pSyncFlags |= SYNC_NOHTTPCOMPRESS; |
| 215 | } |
| 216 | if( find_option("all",0,0)!=0 ){ |
| 217 | *pSyncFlags |= SYNC_ALLURL; |
| 218 | } |
| 219 | url_proxy_options(); |
| 220 | clone_ssh_find_options(); |
| 221 | if( !uvOnly ) db_find_and_open_repository(0, 0); |
| 222 | db_open_config(0, 1); |
| 223 | if( g.argc==2 ){ |
| 224 | if( db_get_boolean("auto-shun",0) ) configSync = CONFIGSET_SHUN; |
| 225 | }else if( g.argc==3 ){ |
| 226 | zUrl = g.argv[2]; |
| 227 | if( (*pSyncFlags) & SYNC_ALLURL ){ |
| 228 | fossil_fatal("cannot use both the --all option and specific URL \"%s\"", |
| 229 | zUrl); |
| 230 | } |
| 231 | } |
| 232 | if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) |
| 233 | && db_get_boolean("uv-sync",0) |
| 234 | ){ |
| 235 | *pSyncFlags |= SYNC_UNVERSIONED; |
| @@ -175,22 +244,14 @@ | |
| 244 | if( g.url.protocol==0 ){ |
| 245 | if( urlOptional ) fossil_exit(0); |
| 246 | usage("URL"); |
| 247 | } |
| 248 | user_select(); |
| 249 | url_enable_proxy("via proxy: "); |
| 250 | *pConfigFlags |= configSync; |
| 251 | } |
| 252 | |
| 253 | |
| 254 | /* |
| 255 | ** COMMAND: pull |
| 256 | ** |
| 257 | ** Usage: %fossil pull ?URL? ?options? |
| @@ -205,10 +266,11 @@ | |
| 266 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 267 | ** details on the URL formats. |
| 268 | ** |
| 269 | ** Options: |
| 270 | ** |
| 271 | ** --all Pull from all remotes, not just the default |
| 272 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 273 | ** if required by the remote website |
| 274 | ** --from-parent-project Pull content from the parent project |
| 275 | ** --ipv4 Use only IPv4, not IPv6 |
| 276 | ** --no-http-compression Do not compress HTTP traffic |
| @@ -237,11 +299,11 @@ | |
| 299 | process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags); |
| 300 | |
| 301 | /* We should be done with options.. */ |
| 302 | verify_all_options(); |
| 303 | |
| 304 | client_sync_all_urls(syncFlags, configFlags, 0, zAltPCode); |
| 305 | } |
| 306 | |
| 307 | /* |
| 308 | ** COMMAND: push |
| 309 | ** |
| @@ -257,10 +319,11 @@ | |
| 319 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 320 | ** details on the URL formats. |
| 321 | ** |
| 322 | ** Options: |
| 323 | ** |
| 324 | ** --all Push to all remotes, not just the default |
| 325 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 326 | ** if required by the remote website |
| 327 | ** --ipv4 Use only IPv4, not IPv6 |
| 328 | ** --no-http-compression Do not compress HTTP traffic |
| 329 | ** --once Do not remember URL for subsequent syncs |
| @@ -284,11 +347,11 @@ | |
| 347 | verify_all_options(); |
| 348 | |
| 349 | if( db_get_boolean("dont-push",0) ){ |
| 350 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 351 | } |
| 352 | client_sync_all_urls(syncFlags, 0, 0, 0); |
| 353 | } |
| 354 | |
| 355 | |
| 356 | /* |
| 357 | ** COMMAND: sync |
| @@ -303,10 +366,11 @@ | |
| 366 | ** pull, remote, or sync command is used. See "fossil help clone" for |
| 367 | ** details on the URL formats. |
| 368 | ** |
| 369 | ** Options: |
| 370 | ** |
| 371 | ** --all Sync with all remotes, not just the default |
| 372 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 373 | ** if required by the remote website |
| 374 | ** --ipv4 Use only IPv4, not IPv6 |
| 375 | ** --no-http-compression Do not compress HTTP traffic |
| 376 | ** --once Do not remember URL for subsequent syncs |
| @@ -332,14 +396,14 @@ | |
| 396 | |
| 397 | /* We should be done with options.. */ |
| 398 | verify_all_options(); |
| 399 | |
| 400 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 401 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 402 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 403 | } |
| 404 | client_sync_all_urls(syncFlags, configFlags, 0, 0); |
| 405 | } |
| 406 | |
| 407 | /* |
| 408 | ** Handle the "fossil unversioned sync" and "fossil unversioned revert" |
| 409 | ** commands. |
| 410 |
+1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1821,10 +1821,11 @@ | ||
| 1821 | 1821 | #define SYNC_UV_TRACE 0x0400 /* Describe UV activities */ |
| 1822 | 1822 | #define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */ |
| 1823 | 1823 | #define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */ |
| 1824 | 1824 | #define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */ |
| 1825 | 1825 | #define SYNC_NOHTTPCOMPRESS 0x4000 /* Do not compression HTTP messages */ |
| 1826 | +#define SYNC_ALLURL 0x8000 /* The --all flag - sync to all URLs */ | |
| 1826 | 1827 | #endif |
| 1827 | 1828 | |
| 1828 | 1829 | /* |
| 1829 | 1830 | ** Floating-point absolute value |
| 1830 | 1831 | */ |
| 1831 | 1832 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1821,10 +1821,11 @@ | |
| 1821 | #define SYNC_UV_TRACE 0x0400 /* Describe UV activities */ |
| 1822 | #define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */ |
| 1823 | #define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */ |
| 1824 | #define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */ |
| 1825 | #define SYNC_NOHTTPCOMPRESS 0x4000 /* Do not compression HTTP messages */ |
| 1826 | #endif |
| 1827 | |
| 1828 | /* |
| 1829 | ** Floating-point absolute value |
| 1830 | */ |
| 1831 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1821,10 +1821,11 @@ | |
| 1821 | #define SYNC_UV_TRACE 0x0400 /* Describe UV activities */ |
| 1822 | #define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */ |
| 1823 | #define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */ |
| 1824 | #define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */ |
| 1825 | #define SYNC_NOHTTPCOMPRESS 0x4000 /* Do not compression HTTP messages */ |
| 1826 | #define SYNC_ALLURL 0x8000 /* The --all flag - sync to all URLs */ |
| 1827 | #endif |
| 1828 | |
| 1829 | /* |
| 1830 | ** Floating-point absolute value |
| 1831 | */ |
| 1832 |