Fossil SCM
Exit with non-zero code when the pull/push/sync commands fail. Reported off-list by Dan Mestas.
Commit
1cda9ec21038f578e2a6a53db20ded9e39f5550d63a3f2f23c0e24196f52208e
Parent
2355d14ec52c664…
1 file changed
+10
-4
+10
-4
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -46,11 +46,11 @@ | ||
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | /* |
| 49 | 49 | ** Call client_sync() one or more times in order to complete a |
| 50 | 50 | ** sync operation. Usually, client_sync() is called only once, though |
| 51 | -** is can be called multiple times if the SYNC_ALLURL flags is set. | |
| 51 | +** it can be called multiple times if the SYNC_ALLURL flags is set. | |
| 52 | 52 | */ |
| 53 | 53 | static int client_sync_all_urls( |
| 54 | 54 | unsigned syncFlags, /* Mask of SYNC_* flags */ |
| 55 | 55 | unsigned configRcvMask, /* Receive these configuration items */ |
| 56 | 56 | unsigned configSendMask, /* Send these configuration items */ |
| @@ -408,11 +408,13 @@ | ||
| 408 | 408 | process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags); |
| 409 | 409 | |
| 410 | 410 | /* We should be done with options.. */ |
| 411 | 411 | verify_all_options(); |
| 412 | 412 | |
| 413 | - client_sync_all_urls(syncFlags, configFlags, 0, zAltPCode); | |
| 413 | + if( client_sync_all_urls(syncFlags, configFlags, 0, zAltPCode)!=0 ){ | |
| 414 | + fossil_exit(1); | |
| 415 | + } | |
| 414 | 416 | } |
| 415 | 417 | |
| 416 | 418 | /* |
| 417 | 419 | ** COMMAND: push |
| 418 | 420 | ** |
| @@ -458,11 +460,13 @@ | ||
| 458 | 460 | verify_all_options(); |
| 459 | 461 | |
| 460 | 462 | if( db_get_boolean("dont-push",0) ){ |
| 461 | 463 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 462 | 464 | } |
| 463 | - client_sync_all_urls(syncFlags, 0, 0, 0); | |
| 465 | + if( client_sync_all_urls(syncFlags, 0, 0, 0)!=0 ){ | |
| 466 | + fossil_exit(1); | |
| 467 | + } | |
| 464 | 468 | } |
| 465 | 469 | |
| 466 | 470 | |
| 467 | 471 | /* |
| 468 | 472 | ** COMMAND: sync |
| @@ -524,11 +528,13 @@ | ||
| 524 | 528 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 525 | 529 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 526 | 530 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 527 | 531 | } |
| 528 | 532 | } |
| 529 | - client_sync_all_urls(syncFlags, configFlags, 0, 0); | |
| 533 | + if( client_sync_all_urls(syncFlags, configFlags, 0, 0)!=0 ){ | |
| 534 | + fossil_exit(1); | |
| 535 | + } | |
| 530 | 536 | } |
| 531 | 537 | |
| 532 | 538 | /* |
| 533 | 539 | ** Handle the "fossil unversioned sync" and "fossil unversioned revert" |
| 534 | 540 | ** commands. |
| 535 | 541 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -46,11 +46,11 @@ | |
| 46 | |
| 47 | |
| 48 | /* |
| 49 | ** Call client_sync() one or more times in order to complete a |
| 50 | ** sync operation. Usually, client_sync() is called only once, though |
| 51 | ** is can be called multiple times if the SYNC_ALLURL flags is set. |
| 52 | */ |
| 53 | static int client_sync_all_urls( |
| 54 | unsigned syncFlags, /* Mask of SYNC_* flags */ |
| 55 | unsigned configRcvMask, /* Receive these configuration items */ |
| 56 | unsigned configSendMask, /* Send these configuration items */ |
| @@ -408,11 +408,13 @@ | |
| 408 | process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags); |
| 409 | |
| 410 | /* We should be done with options.. */ |
| 411 | verify_all_options(); |
| 412 | |
| 413 | client_sync_all_urls(syncFlags, configFlags, 0, zAltPCode); |
| 414 | } |
| 415 | |
| 416 | /* |
| 417 | ** COMMAND: push |
| 418 | ** |
| @@ -458,11 +460,13 @@ | |
| 458 | verify_all_options(); |
| 459 | |
| 460 | if( db_get_boolean("dont-push",0) ){ |
| 461 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 462 | } |
| 463 | client_sync_all_urls(syncFlags, 0, 0, 0); |
| 464 | } |
| 465 | |
| 466 | |
| 467 | /* |
| 468 | ** COMMAND: sync |
| @@ -524,11 +528,13 @@ | |
| 524 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 525 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 526 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 527 | } |
| 528 | } |
| 529 | client_sync_all_urls(syncFlags, configFlags, 0, 0); |
| 530 | } |
| 531 | |
| 532 | /* |
| 533 | ** Handle the "fossil unversioned sync" and "fossil unversioned revert" |
| 534 | ** commands. |
| 535 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -46,11 +46,11 @@ | |
| 46 | |
| 47 | |
| 48 | /* |
| 49 | ** Call client_sync() one or more times in order to complete a |
| 50 | ** sync operation. Usually, client_sync() is called only once, though |
| 51 | ** it can be called multiple times if the SYNC_ALLURL flags is set. |
| 52 | */ |
| 53 | static int client_sync_all_urls( |
| 54 | unsigned syncFlags, /* Mask of SYNC_* flags */ |
| 55 | unsigned configRcvMask, /* Receive these configuration items */ |
| 56 | unsigned configSendMask, /* Send these configuration items */ |
| @@ -408,11 +408,13 @@ | |
| 408 | process_sync_args(&configFlags, &syncFlags, 0, urlOmitFlags); |
| 409 | |
| 410 | /* We should be done with options.. */ |
| 411 | verify_all_options(); |
| 412 | |
| 413 | if( client_sync_all_urls(syncFlags, configFlags, 0, zAltPCode)!=0 ){ |
| 414 | fossil_exit(1); |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | /* |
| 419 | ** COMMAND: push |
| 420 | ** |
| @@ -458,11 +460,13 @@ | |
| 460 | verify_all_options(); |
| 461 | |
| 462 | if( db_get_boolean("dont-push",0) ){ |
| 463 | fossil_fatal("pushing is prohibited: the 'dont-push' option is set"); |
| 464 | } |
| 465 | if( client_sync_all_urls(syncFlags, 0, 0, 0)!=0 ){ |
| 466 | fossil_exit(1); |
| 467 | } |
| 468 | } |
| 469 | |
| 470 | |
| 471 | /* |
| 472 | ** COMMAND: sync |
| @@ -524,11 +528,13 @@ | |
| 528 | if( db_get_boolean("dont-push",0) ) syncFlags &= ~SYNC_PUSH; |
| 529 | if( (syncFlags & SYNC_PUSH)==0 ){ |
| 530 | fossil_warning("pull only: the 'dont-push' option is set"); |
| 531 | } |
| 532 | } |
| 533 | if( client_sync_all_urls(syncFlags, configFlags, 0, 0)!=0 ){ |
| 534 | fossil_exit(1); |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | /* |
| 539 | ** Handle the "fossil unversioned sync" and "fossil unversioned revert" |
| 540 | ** commands. |
| 541 |