Fossil SCM
In "fossil configuration push", "pull" and "sync", exit with status 1 when the sync reports an error, as "fossil pull" does. A push the server refused exited 0. The received configuration is still applied first.
Commit
9444ac0064e195ef226e6c5b7e887da3577d3f7bbd954670bb1d88e6a1606206
Parent
6d6d6906b94c653…
1 file changed
+5
-3
+5
-3
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -828,10 +828,11 @@ | ||
| 828 | 828 | ** |
| 829 | 829 | ** See also: [[settings]], [[unset]] |
| 830 | 830 | */ |
| 831 | 831 | void configuration_cmd(void){ |
| 832 | 832 | int n; |
| 833 | + int nErr = 0; | |
| 833 | 834 | const char *zMethod; |
| 834 | 835 | db_find_and_open_repository(0, 0); |
| 835 | 836 | db_open_config(0, 0); |
| 836 | 837 | if( g.argc<3 ){ |
| 837 | 838 | usage("SUBCOMMAND ..."); |
| @@ -897,17 +898,17 @@ | ||
| 897 | 898 | user_select(); |
| 898 | 899 | url_enable_proxy("via proxy: "); |
| 899 | 900 | g.zHttpAuth = get_httpauth(); |
| 900 | 901 | if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE; |
| 901 | 902 | if( strncmp(zMethod, "push", n)==0 ){ |
| 902 | - client_sync(0,0,(unsigned)mask,0,0); | |
| 903 | + nErr = client_sync(0,0,(unsigned)mask,0,0); | |
| 903 | 904 | }else if( strncmp(zMethod, "pull", n)==0 ){ |
| 904 | 905 | if( overwriteFlag ) db_unprotect(PROTECT_USER); |
| 905 | - client_sync(0,(unsigned)mask,0,0,0); | |
| 906 | + nErr = client_sync(0,(unsigned)mask,0,0,0); | |
| 906 | 907 | if( overwriteFlag ) db_protect_pop(); |
| 907 | 908 | }else{ |
| 908 | - client_sync(0,(unsigned)mask,(unsigned)mask,0,0); | |
| 909 | + nErr = client_sync(0,(unsigned)mask,(unsigned)mask,0,0); | |
| 909 | 910 | } |
| 910 | 911 | }else |
| 911 | 912 | if( strncmp(zMethod, "reset", n)==0 ){ |
| 912 | 913 | int mask, i; |
| 913 | 914 | char *zBackup; |
| @@ -965,10 +966,11 @@ | ||
| 965 | 966 | { |
| 966 | 967 | fossil_fatal("METHOD should be one of:" |
| 967 | 968 | " export import merge pull push reset"); |
| 968 | 969 | } |
| 969 | 970 | configure_rebuild(); |
| 971 | + if( nErr ) fossil_exit(1); | |
| 970 | 972 | } |
| 971 | 973 | |
| 972 | 974 | |
| 973 | 975 | /* |
| 974 | 976 | ** COMMAND: test-var-list |
| 975 | 977 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -828,10 +828,11 @@ | |
| 828 | ** |
| 829 | ** See also: [[settings]], [[unset]] |
| 830 | */ |
| 831 | void configuration_cmd(void){ |
| 832 | int n; |
| 833 | const char *zMethod; |
| 834 | db_find_and_open_repository(0, 0); |
| 835 | db_open_config(0, 0); |
| 836 | if( g.argc<3 ){ |
| 837 | usage("SUBCOMMAND ..."); |
| @@ -897,17 +898,17 @@ | |
| 897 | user_select(); |
| 898 | url_enable_proxy("via proxy: "); |
| 899 | g.zHttpAuth = get_httpauth(); |
| 900 | if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE; |
| 901 | if( strncmp(zMethod, "push", n)==0 ){ |
| 902 | client_sync(0,0,(unsigned)mask,0,0); |
| 903 | }else if( strncmp(zMethod, "pull", n)==0 ){ |
| 904 | if( overwriteFlag ) db_unprotect(PROTECT_USER); |
| 905 | client_sync(0,(unsigned)mask,0,0,0); |
| 906 | if( overwriteFlag ) db_protect_pop(); |
| 907 | }else{ |
| 908 | client_sync(0,(unsigned)mask,(unsigned)mask,0,0); |
| 909 | } |
| 910 | }else |
| 911 | if( strncmp(zMethod, "reset", n)==0 ){ |
| 912 | int mask, i; |
| 913 | char *zBackup; |
| @@ -965,10 +966,11 @@ | |
| 965 | { |
| 966 | fossil_fatal("METHOD should be one of:" |
| 967 | " export import merge pull push reset"); |
| 968 | } |
| 969 | configure_rebuild(); |
| 970 | } |
| 971 | |
| 972 | |
| 973 | /* |
| 974 | ** COMMAND: test-var-list |
| 975 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -828,10 +828,11 @@ | |
| 828 | ** |
| 829 | ** See also: [[settings]], [[unset]] |
| 830 | */ |
| 831 | void configuration_cmd(void){ |
| 832 | int n; |
| 833 | int nErr = 0; |
| 834 | const char *zMethod; |
| 835 | db_find_and_open_repository(0, 0); |
| 836 | db_open_config(0, 0); |
| 837 | if( g.argc<3 ){ |
| 838 | usage("SUBCOMMAND ..."); |
| @@ -897,17 +898,17 @@ | |
| 898 | user_select(); |
| 899 | url_enable_proxy("via proxy: "); |
| 900 | g.zHttpAuth = get_httpauth(); |
| 901 | if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE; |
| 902 | if( strncmp(zMethod, "push", n)==0 ){ |
| 903 | nErr = client_sync(0,0,(unsigned)mask,0,0); |
| 904 | }else if( strncmp(zMethod, "pull", n)==0 ){ |
| 905 | if( overwriteFlag ) db_unprotect(PROTECT_USER); |
| 906 | nErr = client_sync(0,(unsigned)mask,0,0,0); |
| 907 | if( overwriteFlag ) db_protect_pop(); |
| 908 | }else{ |
| 909 | nErr = client_sync(0,(unsigned)mask,(unsigned)mask,0,0); |
| 910 | } |
| 911 | }else |
| 912 | if( strncmp(zMethod, "reset", n)==0 ){ |
| 913 | int mask, i; |
| 914 | char *zBackup; |
| @@ -965,10 +966,11 @@ | |
| 966 | { |
| 967 | fossil_fatal("METHOD should be one of:" |
| 968 | " export import merge pull push reset"); |
| 969 | } |
| 970 | configure_rebuild(); |
| 971 | if( nErr ) fossil_exit(1); |
| 972 | } |
| 973 | |
| 974 | |
| 975 | /* |
| 976 | ** COMMAND: test-var-list |
| 977 |