Fossil SCM

Permit the TH1 hooks subsystem to check for the configuration without raising a 'fatal' error.

mistachkin 2016-03-02 02:10 trunk
Commit b06cd631f1804300c5088f85a0ebcc067e20c72d
+1 -1
--- src/allrepo.c
+++ src/allrepo.c
@@ -185,11 +185,11 @@
185185
186186
if( g.argc<3 ){
187187
usage("SUBCOMMAND ...");
188188
}
189189
n = strlen(g.argv[2]);
190
- db_open_config(1);
190
+ db_open_config(1, 0);
191191
blob_zero(&extra);
192192
zCmd = g.argv[2];
193193
if( !login_is_nobody() ) blob_appendf(&extra, " -U %s", g.zLogin);
194194
if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
195195
zCmd = "list";
196196
--- src/allrepo.c
+++ src/allrepo.c
@@ -185,11 +185,11 @@
185
186 if( g.argc<3 ){
187 usage("SUBCOMMAND ...");
188 }
189 n = strlen(g.argv[2]);
190 db_open_config(1);
191 blob_zero(&extra);
192 zCmd = g.argv[2];
193 if( !login_is_nobody() ) blob_appendf(&extra, " -U %s", g.zLogin);
194 if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
195 zCmd = "list";
196
--- src/allrepo.c
+++ src/allrepo.c
@@ -185,11 +185,11 @@
185
186 if( g.argc<3 ){
187 usage("SUBCOMMAND ...");
188 }
189 n = strlen(g.argv[2]);
190 db_open_config(1, 0);
191 blob_zero(&extra);
192 zCmd = g.argv[2];
193 if( !login_is_nobody() ) blob_appendf(&extra, " -U %s", g.zLogin);
194 if( strncmp(zCmd, "list", n)==0 || strncmp(zCmd,"ls",n)==0 ){
195 zCmd = "list";
196
+1 -1
--- src/clone.c
+++ src/clone.c
@@ -141,11 +141,11 @@
141141
verify_all_options();
142142
143143
if( g.argc < 4 ){
144144
usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY");
145145
}
146
- db_open_config(0);
146
+ db_open_config(0, 0);
147147
if( -1 != file_size(g.argv[3]) ){
148148
fossil_fatal("file already exists: %s", g.argv[3]);
149149
}
150150
151151
url_parse(g.argv[2], urlFlags);
152152
--- src/clone.c
+++ src/clone.c
@@ -141,11 +141,11 @@
141 verify_all_options();
142
143 if( g.argc < 4 ){
144 usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY");
145 }
146 db_open_config(0);
147 if( -1 != file_size(g.argv[3]) ){
148 fossil_fatal("file already exists: %s", g.argv[3]);
149 }
150
151 url_parse(g.argv[2], urlFlags);
152
--- src/clone.c
+++ src/clone.c
@@ -141,11 +141,11 @@
141 verify_all_options();
142
143 if( g.argc < 4 ){
144 usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY");
145 }
146 db_open_config(0, 0);
147 if( -1 != file_size(g.argv[3]) ){
148 fossil_fatal("file already exists: %s", g.argv[3]);
149 }
150
151 url_parse(g.argv[2], urlFlags);
152
+1 -1
--- src/configure.c
+++ src/configure.c
@@ -883,11 +883,11 @@
883883
*/
884884
void configuration_cmd(void){
885885
int n;
886886
const char *zMethod;
887887
db_find_and_open_repository(0, 0);
888
- db_open_config(0);
888
+ db_open_config(0, 0);
889889
if( g.argc<3 ){
890890
usage("SUBCOMMAND ...");
891891
}
892892
zMethod = g.argv[2];
893893
n = strlen(zMethod);
894894
--- src/configure.c
+++ src/configure.c
@@ -883,11 +883,11 @@
883 */
884 void configuration_cmd(void){
885 int n;
886 const char *zMethod;
887 db_find_and_open_repository(0, 0);
888 db_open_config(0);
889 if( g.argc<3 ){
890 usage("SUBCOMMAND ...");
891 }
892 zMethod = g.argv[2];
893 n = strlen(zMethod);
894
--- src/configure.c
+++ src/configure.c
@@ -883,11 +883,11 @@
883 */
884 void configuration_cmd(void){
885 int n;
886 const char *zMethod;
887 db_find_and_open_repository(0, 0);
888 db_open_config(0, 0);
889 if( g.argc<3 ){
890 usage("SUBCOMMAND ...");
891 }
892 zMethod = g.argv[2];
893 n = strlen(zMethod);
894
+13 -5
--- src/db.c
+++ src/db.c
@@ -981,15 +981,15 @@
981981
** operations which hold an exclusive transaction. In a few cases, though,
982982
** it is convenient for the ~/.fossil to be attached to the main database
983983
** connection so that we can join between the various databases. In that
984984
** case, invoke this routine with useAttach as 1.
985985
*/
986
-void db_open_config(int useAttach){
986
+int db_open_config(int useAttach, int isOptional){
987987
char *zDbName;
988988
char *zHome;
989989
if( g.zConfigDbName ){
990
- if( useAttach==g.useAttach ) return;
990
+ if( useAttach==g.useAttach ) return 1; /* Already open. */
991991
db_close_config();
992992
}
993993
zHome = fossil_getenv("FOSSIL_HOME");
994994
#if defined(_WIN32) || defined(__CYGWIN__)
995995
if( zHome==0 ){
@@ -1002,24 +1002,27 @@
10021002
if( zDrive && zPath ) zHome = mprintf("%s%s", zDrive, zPath);
10031003
}
10041004
}
10051005
}
10061006
if( zHome==0 ){
1007
+ if( isOptional ) return 0;
10071008
fossil_fatal("cannot locate home directory - please set the "
10081009
"FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH "
10091010
"environment variables");
10101011
}
10111012
#else
10121013
if( zHome==0 ){
10131014
zHome = fossil_getenv("HOME");
10141015
}
10151016
if( zHome==0 ){
1017
+ if( isOptional ) return 0;
10161018
fossil_fatal("cannot locate home directory - please set the "
10171019
"FOSSIL_HOME or HOME environment variables");
10181020
}
10191021
#endif
10201022
if( file_isdir(zHome)!=1 ){
1023
+ if( isOptional ) return 0;
10211024
fossil_fatal("invalid home directory: %s", zHome);
10221025
}
10231026
#if defined(_WIN32) || defined(__CYGWIN__)
10241027
/* . filenames give some window systems problems and many apps problems */
10251028
zDbName = mprintf("%//_fossil", zHome);
@@ -1026,15 +1029,17 @@
10261029
#else
10271030
zDbName = mprintf("%s/.fossil", zHome);
10281031
#endif
10291032
if( file_size(zDbName)<1024*3 ){
10301033
if( file_access(zHome, W_OK) ){
1034
+ if( isOptional ) return 0;
10311035
fossil_fatal("home directory %s must be writeable", zHome);
10321036
}
10331037
db_init_database(zDbName, zConfigSchema, (char*)0);
10341038
}
10351039
if( file_access(zDbName, W_OK) ){
1040
+ if( isOptional ) return 0;
10361041
fossil_fatal("configuration file %s must be writeable", zDbName);
10371042
}
10381043
if( useAttach ){
10391044
db_open_or_attach(zDbName, "configdb", &g.useAttach);
10401045
g.dbConfig = 0;
@@ -1043,10 +1048,11 @@
10431048
g.useAttach = 0;
10441049
g.dbConfig = db_open(zDbName);
10451050
g.zConfigDbType = "configdb";
10461051
}
10471052
g.zConfigDbName = zDbName;
1053
+ return 1;
10481054
}
10491055
10501056
/*
10511057
** Return TRUE if zTable exists.
10521058
*/
@@ -1156,20 +1162,22 @@
11561162
n = strlen(zPwd);
11571163
while( n>0 ){
11581164
for(i=0; i<count(aDbName); i++){
11591165
sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]);
11601166
if( isValidLocalDb(zPwd) ){
1167
+ if( db_open_config(0, 1)==0 ){
1168
+ return 0; /* Configuration could not be opened */
1169
+ }
11611170
/* Found a valid checkout database file */
11621171
g.zLocalDbName = mprintf("%s", zPwd);
11631172
zPwd[n] = 0;
11641173
while( n>0 && zPwd[n-1]=='/' ){
11651174
n--;
11661175
zPwd[n] = 0;
11671176
}
11681177
g.zLocalRoot = mprintf("%s/", zPwd);
11691178
g.localOpen = 1;
1170
- db_open_config(0);
11711179
db_open_repository(zDbName);
11721180
return 1;
11731181
}
11741182
}
11751183
n--;
@@ -1730,11 +1738,11 @@
17301738
fossil_fatal("file already exists: %s", g.argv[2]);
17311739
}
17321740
17331741
db_create_repository(g.argv[2]);
17341742
db_open_repository(g.argv[2]);
1735
- db_open_config(0);
1743
+ db_open_config(0, 0);
17361744
if( zTemplate ) db_attach(zTemplate, "settingSrc");
17371745
db_begin_transaction();
17381746
if( zDate==0 ) zDate = "now";
17391747
db_initial_setup(zTemplate, zDate, zDefaultUser);
17401748
db_end_transaction(0);
@@ -2823,11 +2831,11 @@
28232831
*/
28242832
void setting_cmd(void){
28252833
int i;
28262834
int globalFlag = find_option("global","g",0)!=0;
28272835
int unsetFlag = g.argv[1][0]=='u';
2828
- db_open_config(1);
2836
+ db_open_config(1, 0);
28292837
if( !globalFlag ){
28302838
db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0);
28312839
}
28322840
if( !g.repositoryOpen ){
28332841
globalFlag = 1;
28342842
--- src/db.c
+++ src/db.c
@@ -981,15 +981,15 @@
981 ** operations which hold an exclusive transaction. In a few cases, though,
982 ** it is convenient for the ~/.fossil to be attached to the main database
983 ** connection so that we can join between the various databases. In that
984 ** case, invoke this routine with useAttach as 1.
985 */
986 void db_open_config(int useAttach){
987 char *zDbName;
988 char *zHome;
989 if( g.zConfigDbName ){
990 if( useAttach==g.useAttach ) return;
991 db_close_config();
992 }
993 zHome = fossil_getenv("FOSSIL_HOME");
994 #if defined(_WIN32) || defined(__CYGWIN__)
995 if( zHome==0 ){
@@ -1002,24 +1002,27 @@
1002 if( zDrive && zPath ) zHome = mprintf("%s%s", zDrive, zPath);
1003 }
1004 }
1005 }
1006 if( zHome==0 ){
 
1007 fossil_fatal("cannot locate home directory - please set the "
1008 "FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH "
1009 "environment variables");
1010 }
1011 #else
1012 if( zHome==0 ){
1013 zHome = fossil_getenv("HOME");
1014 }
1015 if( zHome==0 ){
 
1016 fossil_fatal("cannot locate home directory - please set the "
1017 "FOSSIL_HOME or HOME environment variables");
1018 }
1019 #endif
1020 if( file_isdir(zHome)!=1 ){
 
1021 fossil_fatal("invalid home directory: %s", zHome);
1022 }
1023 #if defined(_WIN32) || defined(__CYGWIN__)
1024 /* . filenames give some window systems problems and many apps problems */
1025 zDbName = mprintf("%//_fossil", zHome);
@@ -1026,15 +1029,17 @@
1026 #else
1027 zDbName = mprintf("%s/.fossil", zHome);
1028 #endif
1029 if( file_size(zDbName)<1024*3 ){
1030 if( file_access(zHome, W_OK) ){
 
1031 fossil_fatal("home directory %s must be writeable", zHome);
1032 }
1033 db_init_database(zDbName, zConfigSchema, (char*)0);
1034 }
1035 if( file_access(zDbName, W_OK) ){
 
1036 fossil_fatal("configuration file %s must be writeable", zDbName);
1037 }
1038 if( useAttach ){
1039 db_open_or_attach(zDbName, "configdb", &g.useAttach);
1040 g.dbConfig = 0;
@@ -1043,10 +1048,11 @@
1043 g.useAttach = 0;
1044 g.dbConfig = db_open(zDbName);
1045 g.zConfigDbType = "configdb";
1046 }
1047 g.zConfigDbName = zDbName;
 
1048 }
1049
1050 /*
1051 ** Return TRUE if zTable exists.
1052 */
@@ -1156,20 +1162,22 @@
1156 n = strlen(zPwd);
1157 while( n>0 ){
1158 for(i=0; i<count(aDbName); i++){
1159 sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]);
1160 if( isValidLocalDb(zPwd) ){
 
 
 
1161 /* Found a valid checkout database file */
1162 g.zLocalDbName = mprintf("%s", zPwd);
1163 zPwd[n] = 0;
1164 while( n>0 && zPwd[n-1]=='/' ){
1165 n--;
1166 zPwd[n] = 0;
1167 }
1168 g.zLocalRoot = mprintf("%s/", zPwd);
1169 g.localOpen = 1;
1170 db_open_config(0);
1171 db_open_repository(zDbName);
1172 return 1;
1173 }
1174 }
1175 n--;
@@ -1730,11 +1738,11 @@
1730 fossil_fatal("file already exists: %s", g.argv[2]);
1731 }
1732
1733 db_create_repository(g.argv[2]);
1734 db_open_repository(g.argv[2]);
1735 db_open_config(0);
1736 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1737 db_begin_transaction();
1738 if( zDate==0 ) zDate = "now";
1739 db_initial_setup(zTemplate, zDate, zDefaultUser);
1740 db_end_transaction(0);
@@ -2823,11 +2831,11 @@
2823 */
2824 void setting_cmd(void){
2825 int i;
2826 int globalFlag = find_option("global","g",0)!=0;
2827 int unsetFlag = g.argv[1][0]=='u';
2828 db_open_config(1);
2829 if( !globalFlag ){
2830 db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0);
2831 }
2832 if( !g.repositoryOpen ){
2833 globalFlag = 1;
2834
--- src/db.c
+++ src/db.c
@@ -981,15 +981,15 @@
981 ** operations which hold an exclusive transaction. In a few cases, though,
982 ** it is convenient for the ~/.fossil to be attached to the main database
983 ** connection so that we can join between the various databases. In that
984 ** case, invoke this routine with useAttach as 1.
985 */
986 int db_open_config(int useAttach, int isOptional){
987 char *zDbName;
988 char *zHome;
989 if( g.zConfigDbName ){
990 if( useAttach==g.useAttach ) return 1; /* Already open. */
991 db_close_config();
992 }
993 zHome = fossil_getenv("FOSSIL_HOME");
994 #if defined(_WIN32) || defined(__CYGWIN__)
995 if( zHome==0 ){
@@ -1002,24 +1002,27 @@
1002 if( zDrive && zPath ) zHome = mprintf("%s%s", zDrive, zPath);
1003 }
1004 }
1005 }
1006 if( zHome==0 ){
1007 if( isOptional ) return 0;
1008 fossil_fatal("cannot locate home directory - please set the "
1009 "FOSSIL_HOME, LOCALAPPDATA, APPDATA, or HOMEPATH "
1010 "environment variables");
1011 }
1012 #else
1013 if( zHome==0 ){
1014 zHome = fossil_getenv("HOME");
1015 }
1016 if( zHome==0 ){
1017 if( isOptional ) return 0;
1018 fossil_fatal("cannot locate home directory - please set the "
1019 "FOSSIL_HOME or HOME environment variables");
1020 }
1021 #endif
1022 if( file_isdir(zHome)!=1 ){
1023 if( isOptional ) return 0;
1024 fossil_fatal("invalid home directory: %s", zHome);
1025 }
1026 #if defined(_WIN32) || defined(__CYGWIN__)
1027 /* . filenames give some window systems problems and many apps problems */
1028 zDbName = mprintf("%//_fossil", zHome);
@@ -1026,15 +1029,17 @@
1029 #else
1030 zDbName = mprintf("%s/.fossil", zHome);
1031 #endif
1032 if( file_size(zDbName)<1024*3 ){
1033 if( file_access(zHome, W_OK) ){
1034 if( isOptional ) return 0;
1035 fossil_fatal("home directory %s must be writeable", zHome);
1036 }
1037 db_init_database(zDbName, zConfigSchema, (char*)0);
1038 }
1039 if( file_access(zDbName, W_OK) ){
1040 if( isOptional ) return 0;
1041 fossil_fatal("configuration file %s must be writeable", zDbName);
1042 }
1043 if( useAttach ){
1044 db_open_or_attach(zDbName, "configdb", &g.useAttach);
1045 g.dbConfig = 0;
@@ -1043,10 +1048,11 @@
1048 g.useAttach = 0;
1049 g.dbConfig = db_open(zDbName);
1050 g.zConfigDbType = "configdb";
1051 }
1052 g.zConfigDbName = zDbName;
1053 return 1;
1054 }
1055
1056 /*
1057 ** Return TRUE if zTable exists.
1058 */
@@ -1156,20 +1162,22 @@
1162 n = strlen(zPwd);
1163 while( n>0 ){
1164 for(i=0; i<count(aDbName); i++){
1165 sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]);
1166 if( isValidLocalDb(zPwd) ){
1167 if( db_open_config(0, 1)==0 ){
1168 return 0; /* Configuration could not be opened */
1169 }
1170 /* Found a valid checkout database file */
1171 g.zLocalDbName = mprintf("%s", zPwd);
1172 zPwd[n] = 0;
1173 while( n>0 && zPwd[n-1]=='/' ){
1174 n--;
1175 zPwd[n] = 0;
1176 }
1177 g.zLocalRoot = mprintf("%s/", zPwd);
1178 g.localOpen = 1;
 
1179 db_open_repository(zDbName);
1180 return 1;
1181 }
1182 }
1183 n--;
@@ -1730,11 +1738,11 @@
1738 fossil_fatal("file already exists: %s", g.argv[2]);
1739 }
1740
1741 db_create_repository(g.argv[2]);
1742 db_open_repository(g.argv[2]);
1743 db_open_config(0, 0);
1744 if( zTemplate ) db_attach(zTemplate, "settingSrc");
1745 db_begin_transaction();
1746 if( zDate==0 ) zDate = "now";
1747 db_initial_setup(zTemplate, zDate, zDefaultUser);
1748 db_end_transaction(0);
@@ -2823,11 +2831,11 @@
2831 */
2832 void setting_cmd(void){
2833 int i;
2834 int globalFlag = find_option("global","g",0)!=0;
2835 int unsetFlag = g.argv[1][0]=='u';
2836 db_open_config(1, 0);
2837 if( !globalFlag ){
2838 db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0);
2839 }
2840 if( !g.repositoryOpen ){
2841 globalFlag = 1;
2842
+1 -1
--- src/import.c
+++ src/import.c
@@ -1564,11 +1564,11 @@
15641564
if( !incrFlag ){
15651565
if( forceFlag ) file_delete(g.argv[2]);
15661566
db_create_repository(g.argv[2]);
15671567
}
15681568
db_open_repository(g.argv[2]);
1569
- db_open_config(0);
1569
+ db_open_config(0, 0);
15701570
15711571
db_begin_transaction();
15721572
if( !incrFlag ) db_initial_setup(0, 0, 0);
15731573
15741574
if( svnFlag ){
15751575
--- src/import.c
+++ src/import.c
@@ -1564,11 +1564,11 @@
1564 if( !incrFlag ){
1565 if( forceFlag ) file_delete(g.argv[2]);
1566 db_create_repository(g.argv[2]);
1567 }
1568 db_open_repository(g.argv[2]);
1569 db_open_config(0);
1570
1571 db_begin_transaction();
1572 if( !incrFlag ) db_initial_setup(0, 0, 0);
1573
1574 if( svnFlag ){
1575
--- src/import.c
+++ src/import.c
@@ -1564,11 +1564,11 @@
1564 if( !incrFlag ){
1565 if( forceFlag ) file_delete(g.argv[2]);
1566 db_create_repository(g.argv[2]);
1567 }
1568 db_open_repository(g.argv[2]);
1569 db_open_config(0, 0);
1570
1571 db_begin_transaction();
1572 if( !incrFlag ) db_initial_setup(0, 0, 0);
1573
1574 if( svnFlag ){
1575
+1 -1
--- src/info.c
+++ src/info.c
@@ -184,11 +184,11 @@
184184
if( !verboseFlag ){
185185
verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
186186
}
187187
188188
if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){
189
- db_open_config(0);
189
+ db_open_config(0, 0);
190190
db_open_repository(g.argv[2]);
191191
db_record_repository_filename(g.argv[2]);
192192
fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>"));
193193
fossil_print("project-code: %s\n", db_get("project-code", "<none>"));
194194
extraRepoInfo();
195195
--- src/info.c
+++ src/info.c
@@ -184,11 +184,11 @@
184 if( !verboseFlag ){
185 verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
186 }
187
188 if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){
189 db_open_config(0);
190 db_open_repository(g.argv[2]);
191 db_record_repository_filename(g.argv[2]);
192 fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>"));
193 fossil_print("project-code: %s\n", db_get("project-code", "<none>"));
194 extraRepoInfo();
195
--- src/info.c
+++ src/info.c
@@ -184,11 +184,11 @@
184 if( !verboseFlag ){
185 verboseFlag = find_option("detail","l",0)!=0; /* deprecated */
186 }
187
188 if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){
189 db_open_config(0, 0);
190 db_open_repository(g.argv[2]);
191 db_record_repository_filename(g.argv[2]);
192 fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>"));
193 fossil_print("project-code: %s\n", db_get("project-code", "<none>"));
194 extraRepoInfo();
195
+1 -1
--- src/rebuild.c
+++ src/rebuild.c
@@ -958,11 +958,11 @@
958958
db_open_repository(g.argv[2]);
959959
960960
/* We should be done with options.. */
961961
verify_all_options();
962962
963
- db_open_config(0);
963
+ db_open_config(0, 0);
964964
db_begin_transaction();
965965
db_initial_setup(0, 0, 0);
966966
967967
fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]);
968968
recon_read_dir(g.argv[3]);
969969
--- src/rebuild.c
+++ src/rebuild.c
@@ -958,11 +958,11 @@
958 db_open_repository(g.argv[2]);
959
960 /* We should be done with options.. */
961 verify_all_options();
962
963 db_open_config(0);
964 db_begin_transaction();
965 db_initial_setup(0, 0, 0);
966
967 fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]);
968 recon_read_dir(g.argv[3]);
969
--- src/rebuild.c
+++ src/rebuild.c
@@ -958,11 +958,11 @@
958 db_open_repository(g.argv[2]);
959
960 /* We should be done with options.. */
961 verify_all_options();
962
963 db_open_config(0, 0);
964 db_begin_transaction();
965 db_initial_setup(0, 0, 0);
966
967 fossil_print("Reading files from directory \"%s\"...\n", g.argv[3]);
968 recon_read_dir(g.argv[3]);
969
+1 -1
--- src/stash.c
+++ src/stash.c
@@ -478,11 +478,11 @@
478478
const char *zCmd;
479479
int nCmd;
480480
int stashid = 0;
481481
undo_capture_command_line();
482482
db_must_be_within_tree();
483
- db_open_config(0);
483
+ db_open_config(0, 0);
484484
db_begin_transaction();
485485
zDb = db_name("localdb");
486486
db_multi_exec(zStashInit /*works-like:"%w,%w"*/, zDb, zDb);
487487
if( g.argc<=2 ){
488488
zCmd = "save";
489489
--- src/stash.c
+++ src/stash.c
@@ -478,11 +478,11 @@
478 const char *zCmd;
479 int nCmd;
480 int stashid = 0;
481 undo_capture_command_line();
482 db_must_be_within_tree();
483 db_open_config(0);
484 db_begin_transaction();
485 zDb = db_name("localdb");
486 db_multi_exec(zStashInit /*works-like:"%w,%w"*/, zDb, zDb);
487 if( g.argc<=2 ){
488 zCmd = "save";
489
--- src/stash.c
+++ src/stash.c
@@ -478,11 +478,11 @@
478 const char *zCmd;
479 int nCmd;
480 int stashid = 0;
481 undo_capture_command_line();
482 db_must_be_within_tree();
483 db_open_config(0, 0);
484 db_begin_transaction();
485 zDb = db_name("localdb");
486 db_multi_exec(zStashInit /*works-like:"%w,%w"*/, zDb, zDb);
487 if( g.argc<=2 ){
488 zCmd = "save";
489
+1 -1
--- src/sync.c
+++ src/sync.c
@@ -128,11 +128,11 @@
128128
*pSyncFlags |= SYNC_RESYNC;
129129
}
130130
url_proxy_options();
131131
clone_ssh_find_options();
132132
db_find_and_open_repository(0, 0);
133
- db_open_config(0);
133
+ db_open_config(0, 0);
134134
if( g.argc==2 ){
135135
if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
136136
}else if( g.argc==3 ){
137137
zUrl = g.argv[2];
138138
}
139139
--- src/sync.c
+++ src/sync.c
@@ -128,11 +128,11 @@
128 *pSyncFlags |= SYNC_RESYNC;
129 }
130 url_proxy_options();
131 clone_ssh_find_options();
132 db_find_and_open_repository(0, 0);
133 db_open_config(0);
134 if( g.argc==2 ){
135 if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
136 }else if( g.argc==3 ){
137 zUrl = g.argv[2];
138 }
139
--- src/sync.c
+++ src/sync.c
@@ -128,11 +128,11 @@
128 *pSyncFlags |= SYNC_RESYNC;
129 }
130 url_proxy_options();
131 clone_ssh_find_options();
132 db_find_and_open_repository(0, 0);
133 db_open_config(0, 0);
134 if( g.argc==2 ){
135 if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
136 }else if( g.argc==3 ){
137 zUrl = g.argv[2];
138 }
139
+1 -1
--- src/th_main.c
+++ src/th_main.c
@@ -1766,11 +1766,11 @@
17661766
}else{
17671767
g.th1Flags &= ~TH_STATE_REPOSITORY;
17681768
}
17691769
}
17701770
if( !Th_IsConfigOpen() ){
1771
- db_open_config(0);
1771
+ db_open_config(0, 1);
17721772
if( Th_IsConfigOpen() ){
17731773
g.th1Flags |= TH_STATE_CONFIG;
17741774
}else{
17751775
g.th1Flags &= ~TH_STATE_CONFIG;
17761776
}
17771777
--- src/th_main.c
+++ src/th_main.c
@@ -1766,11 +1766,11 @@
1766 }else{
1767 g.th1Flags &= ~TH_STATE_REPOSITORY;
1768 }
1769 }
1770 if( !Th_IsConfigOpen() ){
1771 db_open_config(0);
1772 if( Th_IsConfigOpen() ){
1773 g.th1Flags |= TH_STATE_CONFIG;
1774 }else{
1775 g.th1Flags &= ~TH_STATE_CONFIG;
1776 }
1777
--- src/th_main.c
+++ src/th_main.c
@@ -1766,11 +1766,11 @@
1766 }else{
1767 g.th1Flags &= ~TH_STATE_REPOSITORY;
1768 }
1769 }
1770 if( !Th_IsConfigOpen() ){
1771 db_open_config(0, 1);
1772 if( Th_IsConfigOpen() ){
1773 g.th1Flags |= TH_STATE_CONFIG;
1774 }else{
1775 g.th1Flags &= ~TH_STATE_CONFIG;
1776 }
1777

Keyboard Shortcuts

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