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.

dmestas 2026-11-19 12:22 UTC small-fixes
Commit 9444ac0064e195ef226e6c5b7e887da3577d3f7bbd954670bb1d88e6a1606206
1 file changed +5 -3
+5 -3
--- src/configure.c
+++ src/configure.c
@@ -828,10 +828,11 @@
828828
**
829829
** See also: [[settings]], [[unset]]
830830
*/
831831
void configuration_cmd(void){
832832
int n;
833
+ int nErr = 0;
833834
const char *zMethod;
834835
db_find_and_open_repository(0, 0);
835836
db_open_config(0, 0);
836837
if( g.argc<3 ){
837838
usage("SUBCOMMAND ...");
@@ -897,17 +898,17 @@
897898
user_select();
898899
url_enable_proxy("via proxy: ");
899900
g.zHttpAuth = get_httpauth();
900901
if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE;
901902
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);
903904
}else if( strncmp(zMethod, "pull", n)==0 ){
904905
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);
906907
if( overwriteFlag ) db_protect_pop();
907908
}else{
908
- client_sync(0,(unsigned)mask,(unsigned)mask,0,0);
909
+ nErr = client_sync(0,(unsigned)mask,(unsigned)mask,0,0);
909910
}
910911
}else
911912
if( strncmp(zMethod, "reset", n)==0 ){
912913
int mask, i;
913914
char *zBackup;
@@ -965,10 +966,11 @@
965966
{
966967
fossil_fatal("METHOD should be one of:"
967968
" export import merge pull push reset");
968969
}
969970
configure_rebuild();
971
+ if( nErr ) fossil_exit(1);
970972
}
971973
972974
973975
/*
974976
** COMMAND: test-var-list
975977
--- 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

Keyboard Shortcuts

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