Fossil SCM

Add check for win32/cygwin whether the config-db is writable in stead of checking that the $HOME directory is writable. Eliminate g.zHome and g.configOpen, in stead use a single g.configDbName. Then people no longer have to guess whether the config db name is ".fossil" or "_fossil". g.zHome was only used for locating the config db, nothing else.

jan.nijtmans 2013-03-05 12:17 trunk merge
Commit 473e08a6d190a66c4fc9a44e0fa83010f23302d6
--- src/checkin.c
+++ src/checkin.c
@@ -203,10 +203,13 @@
203203
int vid;
204204
db_must_be_within_tree();
205205
/* 012345678901234 */
206206
fossil_print("repository: %s\n", db_repository_filename());
207207
fossil_print("local-root: %s\n", g.zLocalRoot);
208
+ if( g.configDbName ){
209
+ fossil_print("config-db: %s\n", g.configDbName);
210
+ }
208211
vid = db_lget_int("checkout", 0);
209212
if( vid ){
210213
show_common_info(vid, "checkout:", 1, 1);
211214
}
212215
db_record_repository_filename(0);
213216
--- src/checkin.c
+++ src/checkin.c
@@ -203,10 +203,13 @@
203 int vid;
204 db_must_be_within_tree();
205 /* 012345678901234 */
206 fossil_print("repository: %s\n", db_repository_filename());
207 fossil_print("local-root: %s\n", g.zLocalRoot);
 
 
 
208 vid = db_lget_int("checkout", 0);
209 if( vid ){
210 show_common_info(vid, "checkout:", 1, 1);
211 }
212 db_record_repository_filename(0);
213
--- src/checkin.c
+++ src/checkin.c
@@ -203,10 +203,13 @@
203 int vid;
204 db_must_be_within_tree();
205 /* 012345678901234 */
206 fossil_print("repository: %s\n", db_repository_filename());
207 fossil_print("local-root: %s\n", g.zLocalRoot);
208 if( g.configDbName ){
209 fossil_print("config-db: %s\n", g.configDbName);
210 }
211 vid = db_lget_int("checkout", 0);
212 if( vid ){
213 show_common_info(vid, "checkout:", 1, 1);
214 }
215 db_record_repository_filename(0);
216
--- src/checkin.c
+++ src/checkin.c
@@ -203,10 +203,13 @@
203203
int vid;
204204
db_must_be_within_tree();
205205
/* 012345678901234 */
206206
fossil_print("repository: %s\n", db_repository_filename());
207207
fossil_print("local-root: %s\n", g.zLocalRoot);
208
+ if( g.configDbName ){
209
+ fossil_print("config-db: %s\n", g.configDbName);
210
+ }
208211
vid = db_lget_int("checkout", 0);
209212
if( vid ){
210213
show_common_info(vid, "checkout:", 1, 1);
211214
}
212215
db_record_repository_filename(0);
213216
--- src/checkin.c
+++ src/checkin.c
@@ -203,10 +203,13 @@
203 int vid;
204 db_must_be_within_tree();
205 /* 012345678901234 */
206 fossil_print("repository: %s\n", db_repository_filename());
207 fossil_print("local-root: %s\n", g.zLocalRoot);
 
 
 
208 vid = db_lget_int("checkout", 0);
209 if( vid ){
210 show_common_info(vid, "checkout:", 1, 1);
211 }
212 db_record_repository_filename(0);
213
--- src/checkin.c
+++ src/checkin.c
@@ -203,10 +203,13 @@
203 int vid;
204 db_must_be_within_tree();
205 /* 012345678901234 */
206 fossil_print("repository: %s\n", db_repository_filename());
207 fossil_print("local-root: %s\n", g.zLocalRoot);
208 if( g.configDbName ){
209 fossil_print("config-db: %s\n", g.configDbName);
210 }
211 vid = db_lget_int("checkout", 0);
212 if( vid ){
213 show_common_info(vid, "checkout:", 1, 1);
214 }
215 db_record_repository_filename(0);
216
+14 -22
--- src/db.c
+++ src/db.c
@@ -792,11 +792,11 @@
792792
** case, invoke this routine with useAttach as 1.
793793
*/
794794
void db_open_config(int useAttach){
795795
char *zDbName;
796796
char *zHome;
797
- if( g.configOpen ) return;
797
+ if( g.configDbName ) return;
798798
#if defined(_WIN32) || defined(__CYGWIN__)
799799
zHome = fossil_getenv("LOCALAPPDATA");
800800
if( zHome==0 ){
801801
zHome = fossil_getenv("APPDATA");
802802
if( zHome==0 ){
@@ -803,18 +803,10 @@
803803
char *zDrive = fossil_getenv("HOMEDRIVE");
804804
zHome = fossil_getenv("HOMEPATH");
805805
if( zDrive && zHome ) zHome = mprintf("%s%s", zDrive, zHome);
806806
}
807807
}
808
-#if defined(__CYGWIN__)
809
- if( zHome!=0 ){
810
- /* We now have the win32 path, but we need the Cygwin equivalent. */
811
- char *zPath = fossil_utf8_to_filename(zHome);
812
- fossil_filename_free(zHome);
813
- zHome = zPath;
814
- }
815
-#endif
816808
if( zHome==0 ){
817809
fossil_fatal("cannot locate home directory - "
818810
"please set the LOCALAPPDATA or APPDATA or HOMEPATH "
819811
"environment variables");
820812
}
@@ -826,37 +818,37 @@
826818
}
827819
#endif
828820
if( file_isdir(zHome)!=1 ){
829821
fossil_fatal("invalid home directory: %s", zHome);
830822
}
831
-#if !defined(_WIN32)
832
- if( file_access(zHome, W_OK) ){
833
- fossil_fatal("home directory %s must be writeable", zHome);
834
- }
835
-#endif
836
- g.zHome = mprintf("%/", zHome);
837823
#if defined(_WIN32) || defined(__CYGWIN__)
838824
/* . filenames give some window systems problems and many apps problems */
839825
zDbName = mprintf("%//_fossil", zHome);
840826
#else
827
+ if( file_access(zHome, W_OK) ){
828
+ fossil_fatal("home directory %s must be writeable", zHome);
829
+ }
841830
zDbName = mprintf("%s/.fossil", zHome);
842831
#endif
843832
if( file_size(zDbName)<1024*3 ){
844833
db_init_database(zDbName, zConfigSchema, (char*)0);
845834
}
835
+#if defined(_WIN32) || defined(__CYGWIN__)
836
+ if( file_access(zDbName, W_OK) ){
837
+ fossil_fatal("configuration file %s must be writeable", zDbName);
838
+ }
839
+#endif
846840
if( useAttach ){
847841
db_open_or_attach(zDbName, "configdb", &g.useAttach);
848842
g.dbConfig = 0;
849843
g.zConfigDbType = 0;
850844
}else{
851845
g.useAttach = 0;
852846
g.dbConfig = db_open(zDbName);
853847
g.zConfigDbType = "configdb";
854848
}
855
- g.configOpen = 1;
856
- free(zDbName);
857
- fossil_filename_free(zHome);
849
+ g.configDbName = zDbName;
858850
}
859851
860852
861853
/*
862854
** Returns TRUE if zTable exists in the local database but lacks column
@@ -1212,11 +1204,11 @@
12121204
fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
12131205
}
12141206
}
12151207
g.repositoryOpen = 0;
12161208
g.localOpen = 0;
1217
- g.configOpen = 0;
1209
+ g.configDbName = NULL;
12181210
sqlite3_wal_checkpoint(g.db, 0);
12191211
sqlite3_close(g.db);
12201212
g.db = 0;
12211213
g.zMainDbType = 0;
12221214
if( g.dbConfig ){
@@ -1775,11 +1767,11 @@
17751767
}
17761768
}
17771769
if( g.repositoryOpen ){
17781770
z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
17791771
}
1780
- if( z==0 && g.configOpen ){
1772
+ if( z==0 && g.configDbName ){
17811773
db_swap_connections();
17821774
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
17831775
db_swap_connections();
17841776
}
17851777
if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
@@ -1822,11 +1814,11 @@
18221814
}
18231815
db_end_transaction(0);
18241816
}
18251817
int db_is_global(const char *zName){
18261818
int rc = 0;
1827
- if( g.configOpen ){
1819
+ if( g.configDbName ){
18281820
db_swap_connections();
18291821
rc = db_exists("SELECT 1 FROM global_config WHERE name=%Q", zName);
18301822
db_swap_connections();
18311823
}
18321824
return rc;
@@ -1843,11 +1835,11 @@
18431835
}
18441836
db_finalize(&q);
18451837
}else{
18461838
rc = SQLITE_DONE;
18471839
}
1848
- if( rc==SQLITE_DONE && g.configOpen ){
1840
+ if( rc==SQLITE_DONE && g.configDbName ){
18491841
db_swap_connections();
18501842
v = db_int(dflt, "SELECT value FROM global_config WHERE name=%Q", zName);
18511843
db_swap_connections();
18521844
}
18531845
return v;
18541846
--- src/db.c
+++ src/db.c
@@ -792,11 +792,11 @@
792 ** case, invoke this routine with useAttach as 1.
793 */
794 void db_open_config(int useAttach){
795 char *zDbName;
796 char *zHome;
797 if( g.configOpen ) return;
798 #if defined(_WIN32) || defined(__CYGWIN__)
799 zHome = fossil_getenv("LOCALAPPDATA");
800 if( zHome==0 ){
801 zHome = fossil_getenv("APPDATA");
802 if( zHome==0 ){
@@ -803,18 +803,10 @@
803 char *zDrive = fossil_getenv("HOMEDRIVE");
804 zHome = fossil_getenv("HOMEPATH");
805 if( zDrive && zHome ) zHome = mprintf("%s%s", zDrive, zHome);
806 }
807 }
808 #if defined(__CYGWIN__)
809 if( zHome!=0 ){
810 /* We now have the win32 path, but we need the Cygwin equivalent. */
811 char *zPath = fossil_utf8_to_filename(zHome);
812 fossil_filename_free(zHome);
813 zHome = zPath;
814 }
815 #endif
816 if( zHome==0 ){
817 fossil_fatal("cannot locate home directory - "
818 "please set the LOCALAPPDATA or APPDATA or HOMEPATH "
819 "environment variables");
820 }
@@ -826,37 +818,37 @@
826 }
827 #endif
828 if( file_isdir(zHome)!=1 ){
829 fossil_fatal("invalid home directory: %s", zHome);
830 }
831 #if !defined(_WIN32)
832 if( file_access(zHome, W_OK) ){
833 fossil_fatal("home directory %s must be writeable", zHome);
834 }
835 #endif
836 g.zHome = mprintf("%/", zHome);
837 #if defined(_WIN32) || defined(__CYGWIN__)
838 /* . filenames give some window systems problems and many apps problems */
839 zDbName = mprintf("%//_fossil", zHome);
840 #else
 
 
 
841 zDbName = mprintf("%s/.fossil", zHome);
842 #endif
843 if( file_size(zDbName)<1024*3 ){
844 db_init_database(zDbName, zConfigSchema, (char*)0);
845 }
 
 
 
 
 
846 if( useAttach ){
847 db_open_or_attach(zDbName, "configdb", &g.useAttach);
848 g.dbConfig = 0;
849 g.zConfigDbType = 0;
850 }else{
851 g.useAttach = 0;
852 g.dbConfig = db_open(zDbName);
853 g.zConfigDbType = "configdb";
854 }
855 g.configOpen = 1;
856 free(zDbName);
857 fossil_filename_free(zHome);
858 }
859
860
861 /*
862 ** Returns TRUE if zTable exists in the local database but lacks column
@@ -1212,11 +1204,11 @@
1212 fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
1213 }
1214 }
1215 g.repositoryOpen = 0;
1216 g.localOpen = 0;
1217 g.configOpen = 0;
1218 sqlite3_wal_checkpoint(g.db, 0);
1219 sqlite3_close(g.db);
1220 g.db = 0;
1221 g.zMainDbType = 0;
1222 if( g.dbConfig ){
@@ -1775,11 +1767,11 @@
1775 }
1776 }
1777 if( g.repositoryOpen ){
1778 z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
1779 }
1780 if( z==0 && g.configOpen ){
1781 db_swap_connections();
1782 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1783 db_swap_connections();
1784 }
1785 if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
@@ -1822,11 +1814,11 @@
1822 }
1823 db_end_transaction(0);
1824 }
1825 int db_is_global(const char *zName){
1826 int rc = 0;
1827 if( g.configOpen ){
1828 db_swap_connections();
1829 rc = db_exists("SELECT 1 FROM global_config WHERE name=%Q", zName);
1830 db_swap_connections();
1831 }
1832 return rc;
@@ -1843,11 +1835,11 @@
1843 }
1844 db_finalize(&q);
1845 }else{
1846 rc = SQLITE_DONE;
1847 }
1848 if( rc==SQLITE_DONE && g.configOpen ){
1849 db_swap_connections();
1850 v = db_int(dflt, "SELECT value FROM global_config WHERE name=%Q", zName);
1851 db_swap_connections();
1852 }
1853 return v;
1854
--- src/db.c
+++ src/db.c
@@ -792,11 +792,11 @@
792 ** case, invoke this routine with useAttach as 1.
793 */
794 void db_open_config(int useAttach){
795 char *zDbName;
796 char *zHome;
797 if( g.configDbName ) return;
798 #if defined(_WIN32) || defined(__CYGWIN__)
799 zHome = fossil_getenv("LOCALAPPDATA");
800 if( zHome==0 ){
801 zHome = fossil_getenv("APPDATA");
802 if( zHome==0 ){
@@ -803,18 +803,10 @@
803 char *zDrive = fossil_getenv("HOMEDRIVE");
804 zHome = fossil_getenv("HOMEPATH");
805 if( zDrive && zHome ) zHome = mprintf("%s%s", zDrive, zHome);
806 }
807 }
 
 
 
 
 
 
 
 
808 if( zHome==0 ){
809 fossil_fatal("cannot locate home directory - "
810 "please set the LOCALAPPDATA or APPDATA or HOMEPATH "
811 "environment variables");
812 }
@@ -826,37 +818,37 @@
818 }
819 #endif
820 if( file_isdir(zHome)!=1 ){
821 fossil_fatal("invalid home directory: %s", zHome);
822 }
 
 
 
 
 
 
823 #if defined(_WIN32) || defined(__CYGWIN__)
824 /* . filenames give some window systems problems and many apps problems */
825 zDbName = mprintf("%//_fossil", zHome);
826 #else
827 if( file_access(zHome, W_OK) ){
828 fossil_fatal("home directory %s must be writeable", zHome);
829 }
830 zDbName = mprintf("%s/.fossil", zHome);
831 #endif
832 if( file_size(zDbName)<1024*3 ){
833 db_init_database(zDbName, zConfigSchema, (char*)0);
834 }
835 #if defined(_WIN32) || defined(__CYGWIN__)
836 if( file_access(zDbName, W_OK) ){
837 fossil_fatal("configuration file %s must be writeable", zDbName);
838 }
839 #endif
840 if( useAttach ){
841 db_open_or_attach(zDbName, "configdb", &g.useAttach);
842 g.dbConfig = 0;
843 g.zConfigDbType = 0;
844 }else{
845 g.useAttach = 0;
846 g.dbConfig = db_open(zDbName);
847 g.zConfigDbType = "configdb";
848 }
849 g.configDbName = zDbName;
 
 
850 }
851
852
853 /*
854 ** Returns TRUE if zTable exists in the local database but lacks column
@@ -1212,11 +1204,11 @@
1204 fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
1205 }
1206 }
1207 g.repositoryOpen = 0;
1208 g.localOpen = 0;
1209 g.configDbName = NULL;
1210 sqlite3_wal_checkpoint(g.db, 0);
1211 sqlite3_close(g.db);
1212 g.db = 0;
1213 g.zMainDbType = 0;
1214 if( g.dbConfig ){
@@ -1775,11 +1767,11 @@
1767 }
1768 }
1769 if( g.repositoryOpen ){
1770 z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
1771 }
1772 if( z==0 && g.configDbName ){
1773 db_swap_connections();
1774 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1775 db_swap_connections();
1776 }
1777 if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
@@ -1822,11 +1814,11 @@
1814 }
1815 db_end_transaction(0);
1816 }
1817 int db_is_global(const char *zName){
1818 int rc = 0;
1819 if( g.configDbName ){
1820 db_swap_connections();
1821 rc = db_exists("SELECT 1 FROM global_config WHERE name=%Q", zName);
1822 db_swap_connections();
1823 }
1824 return rc;
@@ -1843,11 +1835,11 @@
1835 }
1836 db_finalize(&q);
1837 }else{
1838 rc = SQLITE_DONE;
1839 }
1840 if( rc==SQLITE_DONE && g.configDbName ){
1841 db_swap_connections();
1842 v = db_int(dflt, "SELECT value FROM global_config WHERE name=%Q", zName);
1843 db_swap_connections();
1844 }
1845 return v;
1846
+14 -22
--- src/db.c
+++ src/db.c
@@ -792,11 +792,11 @@
792792
** case, invoke this routine with useAttach as 1.
793793
*/
794794
void db_open_config(int useAttach){
795795
char *zDbName;
796796
char *zHome;
797
- if( g.configOpen ) return;
797
+ if( g.configDbName ) return;
798798
#if defined(_WIN32) || defined(__CYGWIN__)
799799
zHome = fossil_getenv("LOCALAPPDATA");
800800
if( zHome==0 ){
801801
zHome = fossil_getenv("APPDATA");
802802
if( zHome==0 ){
@@ -803,18 +803,10 @@
803803
char *zDrive = fossil_getenv("HOMEDRIVE");
804804
zHome = fossil_getenv("HOMEPATH");
805805
if( zDrive && zHome ) zHome = mprintf("%s%s", zDrive, zHome);
806806
}
807807
}
808
-#if defined(__CYGWIN__)
809
- if( zHome!=0 ){
810
- /* We now have the win32 path, but we need the Cygwin equivalent. */
811
- char *zPath = fossil_utf8_to_filename(zHome);
812
- fossil_filename_free(zHome);
813
- zHome = zPath;
814
- }
815
-#endif
816808
if( zHome==0 ){
817809
fossil_fatal("cannot locate home directory - "
818810
"please set the LOCALAPPDATA or APPDATA or HOMEPATH "
819811
"environment variables");
820812
}
@@ -826,37 +818,37 @@
826818
}
827819
#endif
828820
if( file_isdir(zHome)!=1 ){
829821
fossil_fatal("invalid home directory: %s", zHome);
830822
}
831
-#if !defined(_WIN32)
832
- if( file_access(zHome, W_OK) ){
833
- fossil_fatal("home directory %s must be writeable", zHome);
834
- }
835
-#endif
836
- g.zHome = mprintf("%/", zHome);
837823
#if defined(_WIN32) || defined(__CYGWIN__)
838824
/* . filenames give some window systems problems and many apps problems */
839825
zDbName = mprintf("%//_fossil", zHome);
840826
#else
827
+ if( file_access(zHome, W_OK) ){
828
+ fossil_fatal("home directory %s must be writeable", zHome);
829
+ }
841830
zDbName = mprintf("%s/.fossil", zHome);
842831
#endif
843832
if( file_size(zDbName)<1024*3 ){
844833
db_init_database(zDbName, zConfigSchema, (char*)0);
845834
}
835
+#if defined(_WIN32) || defined(__CYGWIN__)
836
+ if( file_access(zDbName, W_OK) ){
837
+ fossil_fatal("configuration file %s must be writeable", zDbName);
838
+ }
839
+#endif
846840
if( useAttach ){
847841
db_open_or_attach(zDbName, "configdb", &g.useAttach);
848842
g.dbConfig = 0;
849843
g.zConfigDbType = 0;
850844
}else{
851845
g.useAttach = 0;
852846
g.dbConfig = db_open(zDbName);
853847
g.zConfigDbType = "configdb";
854848
}
855
- g.configOpen = 1;
856
- free(zDbName);
857
- fossil_filename_free(zHome);
849
+ g.configDbName = zDbName;
858850
}
859851
860852
861853
/*
862854
** Returns TRUE if zTable exists in the local database but lacks column
@@ -1212,11 +1204,11 @@
12121204
fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
12131205
}
12141206
}
12151207
g.repositoryOpen = 0;
12161208
g.localOpen = 0;
1217
- g.configOpen = 0;
1209
+ g.configDbName = NULL;
12181210
sqlite3_wal_checkpoint(g.db, 0);
12191211
sqlite3_close(g.db);
12201212
g.db = 0;
12211213
g.zMainDbType = 0;
12221214
if( g.dbConfig ){
@@ -1775,11 +1767,11 @@
17751767
}
17761768
}
17771769
if( g.repositoryOpen ){
17781770
z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
17791771
}
1780
- if( z==0 && g.configOpen ){
1772
+ if( z==0 && g.configDbName ){
17811773
db_swap_connections();
17821774
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
17831775
db_swap_connections();
17841776
}
17851777
if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
@@ -1822,11 +1814,11 @@
18221814
}
18231815
db_end_transaction(0);
18241816
}
18251817
int db_is_global(const char *zName){
18261818
int rc = 0;
1827
- if( g.configOpen ){
1819
+ if( g.configDbName ){
18281820
db_swap_connections();
18291821
rc = db_exists("SELECT 1 FROM global_config WHERE name=%Q", zName);
18301822
db_swap_connections();
18311823
}
18321824
return rc;
@@ -1843,11 +1835,11 @@
18431835
}
18441836
db_finalize(&q);
18451837
}else{
18461838
rc = SQLITE_DONE;
18471839
}
1848
- if( rc==SQLITE_DONE && g.configOpen ){
1840
+ if( rc==SQLITE_DONE && g.configDbName ){
18491841
db_swap_connections();
18501842
v = db_int(dflt, "SELECT value FROM global_config WHERE name=%Q", zName);
18511843
db_swap_connections();
18521844
}
18531845
return v;
18541846
--- src/db.c
+++ src/db.c
@@ -792,11 +792,11 @@
792 ** case, invoke this routine with useAttach as 1.
793 */
794 void db_open_config(int useAttach){
795 char *zDbName;
796 char *zHome;
797 if( g.configOpen ) return;
798 #if defined(_WIN32) || defined(__CYGWIN__)
799 zHome = fossil_getenv("LOCALAPPDATA");
800 if( zHome==0 ){
801 zHome = fossil_getenv("APPDATA");
802 if( zHome==0 ){
@@ -803,18 +803,10 @@
803 char *zDrive = fossil_getenv("HOMEDRIVE");
804 zHome = fossil_getenv("HOMEPATH");
805 if( zDrive && zHome ) zHome = mprintf("%s%s", zDrive, zHome);
806 }
807 }
808 #if defined(__CYGWIN__)
809 if( zHome!=0 ){
810 /* We now have the win32 path, but we need the Cygwin equivalent. */
811 char *zPath = fossil_utf8_to_filename(zHome);
812 fossil_filename_free(zHome);
813 zHome = zPath;
814 }
815 #endif
816 if( zHome==0 ){
817 fossil_fatal("cannot locate home directory - "
818 "please set the LOCALAPPDATA or APPDATA or HOMEPATH "
819 "environment variables");
820 }
@@ -826,37 +818,37 @@
826 }
827 #endif
828 if( file_isdir(zHome)!=1 ){
829 fossil_fatal("invalid home directory: %s", zHome);
830 }
831 #if !defined(_WIN32)
832 if( file_access(zHome, W_OK) ){
833 fossil_fatal("home directory %s must be writeable", zHome);
834 }
835 #endif
836 g.zHome = mprintf("%/", zHome);
837 #if defined(_WIN32) || defined(__CYGWIN__)
838 /* . filenames give some window systems problems and many apps problems */
839 zDbName = mprintf("%//_fossil", zHome);
840 #else
 
 
 
841 zDbName = mprintf("%s/.fossil", zHome);
842 #endif
843 if( file_size(zDbName)<1024*3 ){
844 db_init_database(zDbName, zConfigSchema, (char*)0);
845 }
 
 
 
 
 
846 if( useAttach ){
847 db_open_or_attach(zDbName, "configdb", &g.useAttach);
848 g.dbConfig = 0;
849 g.zConfigDbType = 0;
850 }else{
851 g.useAttach = 0;
852 g.dbConfig = db_open(zDbName);
853 g.zConfigDbType = "configdb";
854 }
855 g.configOpen = 1;
856 free(zDbName);
857 fossil_filename_free(zHome);
858 }
859
860
861 /*
862 ** Returns TRUE if zTable exists in the local database but lacks column
@@ -1212,11 +1204,11 @@
1212 fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
1213 }
1214 }
1215 g.repositoryOpen = 0;
1216 g.localOpen = 0;
1217 g.configOpen = 0;
1218 sqlite3_wal_checkpoint(g.db, 0);
1219 sqlite3_close(g.db);
1220 g.db = 0;
1221 g.zMainDbType = 0;
1222 if( g.dbConfig ){
@@ -1775,11 +1767,11 @@
1775 }
1776 }
1777 if( g.repositoryOpen ){
1778 z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
1779 }
1780 if( z==0 && g.configOpen ){
1781 db_swap_connections();
1782 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1783 db_swap_connections();
1784 }
1785 if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
@@ -1822,11 +1814,11 @@
1822 }
1823 db_end_transaction(0);
1824 }
1825 int db_is_global(const char *zName){
1826 int rc = 0;
1827 if( g.configOpen ){
1828 db_swap_connections();
1829 rc = db_exists("SELECT 1 FROM global_config WHERE name=%Q", zName);
1830 db_swap_connections();
1831 }
1832 return rc;
@@ -1843,11 +1835,11 @@
1843 }
1844 db_finalize(&q);
1845 }else{
1846 rc = SQLITE_DONE;
1847 }
1848 if( rc==SQLITE_DONE && g.configOpen ){
1849 db_swap_connections();
1850 v = db_int(dflt, "SELECT value FROM global_config WHERE name=%Q", zName);
1851 db_swap_connections();
1852 }
1853 return v;
1854
--- src/db.c
+++ src/db.c
@@ -792,11 +792,11 @@
792 ** case, invoke this routine with useAttach as 1.
793 */
794 void db_open_config(int useAttach){
795 char *zDbName;
796 char *zHome;
797 if( g.configDbName ) return;
798 #if defined(_WIN32) || defined(__CYGWIN__)
799 zHome = fossil_getenv("LOCALAPPDATA");
800 if( zHome==0 ){
801 zHome = fossil_getenv("APPDATA");
802 if( zHome==0 ){
@@ -803,18 +803,10 @@
803 char *zDrive = fossil_getenv("HOMEDRIVE");
804 zHome = fossil_getenv("HOMEPATH");
805 if( zDrive && zHome ) zHome = mprintf("%s%s", zDrive, zHome);
806 }
807 }
 
 
 
 
 
 
 
 
808 if( zHome==0 ){
809 fossil_fatal("cannot locate home directory - "
810 "please set the LOCALAPPDATA or APPDATA or HOMEPATH "
811 "environment variables");
812 }
@@ -826,37 +818,37 @@
818 }
819 #endif
820 if( file_isdir(zHome)!=1 ){
821 fossil_fatal("invalid home directory: %s", zHome);
822 }
 
 
 
 
 
 
823 #if defined(_WIN32) || defined(__CYGWIN__)
824 /* . filenames give some window systems problems and many apps problems */
825 zDbName = mprintf("%//_fossil", zHome);
826 #else
827 if( file_access(zHome, W_OK) ){
828 fossil_fatal("home directory %s must be writeable", zHome);
829 }
830 zDbName = mprintf("%s/.fossil", zHome);
831 #endif
832 if( file_size(zDbName)<1024*3 ){
833 db_init_database(zDbName, zConfigSchema, (char*)0);
834 }
835 #if defined(_WIN32) || defined(__CYGWIN__)
836 if( file_access(zDbName, W_OK) ){
837 fossil_fatal("configuration file %s must be writeable", zDbName);
838 }
839 #endif
840 if( useAttach ){
841 db_open_or_attach(zDbName, "configdb", &g.useAttach);
842 g.dbConfig = 0;
843 g.zConfigDbType = 0;
844 }else{
845 g.useAttach = 0;
846 g.dbConfig = db_open(zDbName);
847 g.zConfigDbType = "configdb";
848 }
849 g.configDbName = zDbName;
 
 
850 }
851
852
853 /*
854 ** Returns TRUE if zTable exists in the local database but lacks column
@@ -1212,11 +1204,11 @@
1204 fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
1205 }
1206 }
1207 g.repositoryOpen = 0;
1208 g.localOpen = 0;
1209 g.configDbName = NULL;
1210 sqlite3_wal_checkpoint(g.db, 0);
1211 sqlite3_close(g.db);
1212 g.db = 0;
1213 g.zMainDbType = 0;
1214 if( g.dbConfig ){
@@ -1775,11 +1767,11 @@
1767 }
1768 }
1769 if( g.repositoryOpen ){
1770 z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
1771 }
1772 if( z==0 && g.configDbName ){
1773 db_swap_connections();
1774 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1775 db_swap_connections();
1776 }
1777 if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
@@ -1822,11 +1814,11 @@
1814 }
1815 db_end_transaction(0);
1816 }
1817 int db_is_global(const char *zName){
1818 int rc = 0;
1819 if( g.configDbName ){
1820 db_swap_connections();
1821 rc = db_exists("SELECT 1 FROM global_config WHERE name=%Q", zName);
1822 db_swap_connections();
1823 }
1824 return rc;
@@ -1843,11 +1835,11 @@
1835 }
1836 db_finalize(&q);
1837 }else{
1838 rc = SQLITE_DONE;
1839 }
1840 if( rc==SQLITE_DONE && g.configDbName ){
1841 db_swap_connections();
1842 v = db_int(dflt, "SELECT value FROM global_config WHERE name=%Q", zName);
1843 db_swap_connections();
1844 }
1845 return v;
1846
+2 -4
--- src/info.c
+++ src/info.c
@@ -198,15 +198,13 @@
198198
if( g.localOpen ){
199199
fossil_print("repository: %s\n", db_repository_filename());
200200
fossil_print("local-root: %s\n", g.zLocalRoot);
201201
}
202202
if( bDetail ) extraRepoInfo();
203
-#if defined(_WIN32)
204
- if( g.zHome ){
205
- fossil_print("user-home: %s\n", g.zHome);
203
+ if( g.configDbName ){
204
+ fossil_print("config-db: %s\n", g.configDbName);
206205
}
207
-#endif
208206
fossil_print("project-code: %s\n", db_get("project-code", ""));
209207
vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
210208
if( vid ){
211209
show_common_info(vid, "checkout:", 1, 1);
212210
}
213211
--- src/info.c
+++ src/info.c
@@ -198,15 +198,13 @@
198 if( g.localOpen ){
199 fossil_print("repository: %s\n", db_repository_filename());
200 fossil_print("local-root: %s\n", g.zLocalRoot);
201 }
202 if( bDetail ) extraRepoInfo();
203 #if defined(_WIN32)
204 if( g.zHome ){
205 fossil_print("user-home: %s\n", g.zHome);
206 }
207 #endif
208 fossil_print("project-code: %s\n", db_get("project-code", ""));
209 vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
210 if( vid ){
211 show_common_info(vid, "checkout:", 1, 1);
212 }
213
--- src/info.c
+++ src/info.c
@@ -198,15 +198,13 @@
198 if( g.localOpen ){
199 fossil_print("repository: %s\n", db_repository_filename());
200 fossil_print("local-root: %s\n", g.zLocalRoot);
201 }
202 if( bDetail ) extraRepoInfo();
203 if( g.configDbName ){
204 fossil_print("config-db: %s\n", g.configDbName);
 
205 }
 
206 fossil_print("project-code: %s\n", db_get("project-code", ""));
207 vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
208 if( vid ){
209 show_common_info(vid, "checkout:", 1, 1);
210 }
211
+2 -4
--- src/info.c
+++ src/info.c
@@ -198,15 +198,13 @@
198198
if( g.localOpen ){
199199
fossil_print("repository: %s\n", db_repository_filename());
200200
fossil_print("local-root: %s\n", g.zLocalRoot);
201201
}
202202
if( bDetail ) extraRepoInfo();
203
-#if defined(_WIN32)
204
- if( g.zHome ){
205
- fossil_print("user-home: %s\n", g.zHome);
203
+ if( g.configDbName ){
204
+ fossil_print("config-db: %s\n", g.configDbName);
206205
}
207
-#endif
208206
fossil_print("project-code: %s\n", db_get("project-code", ""));
209207
vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
210208
if( vid ){
211209
show_common_info(vid, "checkout:", 1, 1);
212210
}
213211
--- src/info.c
+++ src/info.c
@@ -198,15 +198,13 @@
198 if( g.localOpen ){
199 fossil_print("repository: %s\n", db_repository_filename());
200 fossil_print("local-root: %s\n", g.zLocalRoot);
201 }
202 if( bDetail ) extraRepoInfo();
203 #if defined(_WIN32)
204 if( g.zHome ){
205 fossil_print("user-home: %s\n", g.zHome);
206 }
207 #endif
208 fossil_print("project-code: %s\n", db_get("project-code", ""));
209 vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
210 if( vid ){
211 show_common_info(vid, "checkout:", 1, 1);
212 }
213
--- src/info.c
+++ src/info.c
@@ -198,15 +198,13 @@
198 if( g.localOpen ){
199 fossil_print("repository: %s\n", db_repository_filename());
200 fossil_print("local-root: %s\n", g.zLocalRoot);
201 }
202 if( bDetail ) extraRepoInfo();
203 if( g.configDbName ){
204 fossil_print("config-db: %s\n", g.configDbName);
 
205 }
 
206 fossil_print("project-code: %s\n", db_get("project-code", ""));
207 vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
208 if( vid ){
209 show_common_info(vid, "checkout:", 1, 1);
210 }
211
+1 -2
--- src/json.c
+++ src/json.c
@@ -1372,11 +1372,11 @@
13721372
#define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null())
13731373
VAL(capabilities, json_cap_value());
13741374
INT(g, argc);
13751375
INT(g, isConst);
13761376
INT(g, useAttach);
1377
- INT(g, configOpen);
1377
+ CSTR(g, configDbName);
13781378
INT(g, repositoryOpen);
13791379
INT(g, localOpen);
13801380
INT(g, minPrefix);
13811381
INT(g, fSqlTrace);
13821382
INT(g, fSqlStats);
@@ -1410,11 +1410,10 @@
14101410
INT(g, nAux);
14111411
INT(g, allowSymlinks);
14121412
14131413
CSTR(g, zMainDbType);
14141414
CSTR(g, zConfigDbType);
1415
- CSTR(g, zHome);
14161415
CSTR(g, zLocalRoot);
14171416
CSTR(g, zPath);
14181417
CSTR(g, zExtra);
14191418
CSTR(g, zBaseURL);
14201419
CSTR(g, zTop);
14211420
--- src/json.c
+++ src/json.c
@@ -1372,11 +1372,11 @@
1372 #define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null())
1373 VAL(capabilities, json_cap_value());
1374 INT(g, argc);
1375 INT(g, isConst);
1376 INT(g, useAttach);
1377 INT(g, configOpen);
1378 INT(g, repositoryOpen);
1379 INT(g, localOpen);
1380 INT(g, minPrefix);
1381 INT(g, fSqlTrace);
1382 INT(g, fSqlStats);
@@ -1410,11 +1410,10 @@
1410 INT(g, nAux);
1411 INT(g, allowSymlinks);
1412
1413 CSTR(g, zMainDbType);
1414 CSTR(g, zConfigDbType);
1415 CSTR(g, zHome);
1416 CSTR(g, zLocalRoot);
1417 CSTR(g, zPath);
1418 CSTR(g, zExtra);
1419 CSTR(g, zBaseURL);
1420 CSTR(g, zTop);
1421
--- src/json.c
+++ src/json.c
@@ -1372,11 +1372,11 @@
1372 #define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null())
1373 VAL(capabilities, json_cap_value());
1374 INT(g, argc);
1375 INT(g, isConst);
1376 INT(g, useAttach);
1377 CSTR(g, configDbName);
1378 INT(g, repositoryOpen);
1379 INT(g, localOpen);
1380 INT(g, minPrefix);
1381 INT(g, fSqlTrace);
1382 INT(g, fSqlStats);
@@ -1410,11 +1410,10 @@
1410 INT(g, nAux);
1411 INT(g, allowSymlinks);
1412
1413 CSTR(g, zMainDbType);
1414 CSTR(g, zConfigDbType);
 
1415 CSTR(g, zLocalRoot);
1416 CSTR(g, zPath);
1417 CSTR(g, zExtra);
1418 CSTR(g, zBaseURL);
1419 CSTR(g, zTop);
1420
+1 -2
--- src/json.c
+++ src/json.c
@@ -1372,11 +1372,11 @@
13721372
#define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null())
13731373
VAL(capabilities, json_cap_value());
13741374
INT(g, argc);
13751375
INT(g, isConst);
13761376
INT(g, useAttach);
1377
- INT(g, configOpen);
1377
+ CSTR(g, configDbName);
13781378
INT(g, repositoryOpen);
13791379
INT(g, localOpen);
13801380
INT(g, minPrefix);
13811381
INT(g, fSqlTrace);
13821382
INT(g, fSqlStats);
@@ -1410,11 +1410,10 @@
14101410
INT(g, nAux);
14111411
INT(g, allowSymlinks);
14121412
14131413
CSTR(g, zMainDbType);
14141414
CSTR(g, zConfigDbType);
1415
- CSTR(g, zHome);
14161415
CSTR(g, zLocalRoot);
14171416
CSTR(g, zPath);
14181417
CSTR(g, zExtra);
14191418
CSTR(g, zBaseURL);
14201419
CSTR(g, zTop);
14211420
--- src/json.c
+++ src/json.c
@@ -1372,11 +1372,11 @@
1372 #define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null())
1373 VAL(capabilities, json_cap_value());
1374 INT(g, argc);
1375 INT(g, isConst);
1376 INT(g, useAttach);
1377 INT(g, configOpen);
1378 INT(g, repositoryOpen);
1379 INT(g, localOpen);
1380 INT(g, minPrefix);
1381 INT(g, fSqlTrace);
1382 INT(g, fSqlStats);
@@ -1410,11 +1410,10 @@
1410 INT(g, nAux);
1411 INT(g, allowSymlinks);
1412
1413 CSTR(g, zMainDbType);
1414 CSTR(g, zConfigDbType);
1415 CSTR(g, zHome);
1416 CSTR(g, zLocalRoot);
1417 CSTR(g, zPath);
1418 CSTR(g, zExtra);
1419 CSTR(g, zBaseURL);
1420 CSTR(g, zTop);
1421
--- src/json.c
+++ src/json.c
@@ -1372,11 +1372,11 @@
1372 #define VAL(K,V) cson_object_set(o, #K, (V) ? (V) : cson_value_null())
1373 VAL(capabilities, json_cap_value());
1374 INT(g, argc);
1375 INT(g, isConst);
1376 INT(g, useAttach);
1377 CSTR(g, configDbName);
1378 INT(g, repositoryOpen);
1379 INT(g, localOpen);
1380 INT(g, minPrefix);
1381 INT(g, fSqlTrace);
1382 INT(g, fSqlStats);
@@ -1410,11 +1410,10 @@
1410 INT(g, nAux);
1411 INT(g, allowSymlinks);
1412
1413 CSTR(g, zMainDbType);
1414 CSTR(g, zConfigDbType);
 
1415 CSTR(g, zLocalRoot);
1416 CSTR(g, zPath);
1417 CSTR(g, zExtra);
1418 CSTR(g, zBaseURL);
1419 CSTR(g, zTop);
1420
--- src/json_status.c
+++ src/json_status.c
@@ -37,11 +37,10 @@
3737
/*
3838
** Implementation of the /json/status page.
3939
**
4040
*/
4141
cson_value * json_page_status(){
42
- char const * zSql = NULL;
4342
Stmt q = empty_Stmt;
4443
cson_object * oPay;
4544
/*cson_object * files;*/
4645
int vid, nErr = 0;
4746
cson_object * tmpO;
@@ -101,11 +100,10 @@
101100
" WHERE is_selected(id)"
102101
" AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
103102
);
104103
while( db_step(&q)==SQLITE_ROW ){
105104
const char *zPathname = db_column_text(&q,0);
106
- const char *zDisplayName = zPathname;
107105
int isDeleted = db_column_int(&q, 1);
108106
int isChnged = db_column_int(&q,2);
109107
int isNew = db_column_int(&q,3)==0;
110108
int isRenamed = db_column_int(&q,4);
111109
cson_object * oFile;
112110
--- src/json_status.c
+++ src/json_status.c
@@ -37,11 +37,10 @@
37 /*
38 ** Implementation of the /json/status page.
39 **
40 */
41 cson_value * json_page_status(){
42 char const * zSql = NULL;
43 Stmt q = empty_Stmt;
44 cson_object * oPay;
45 /*cson_object * files;*/
46 int vid, nErr = 0;
47 cson_object * tmpO;
@@ -101,11 +100,10 @@
101 " WHERE is_selected(id)"
102 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
103 );
104 while( db_step(&q)==SQLITE_ROW ){
105 const char *zPathname = db_column_text(&q,0);
106 const char *zDisplayName = zPathname;
107 int isDeleted = db_column_int(&q, 1);
108 int isChnged = db_column_int(&q,2);
109 int isNew = db_column_int(&q,3)==0;
110 int isRenamed = db_column_int(&q,4);
111 cson_object * oFile;
112
--- src/json_status.c
+++ src/json_status.c
@@ -37,11 +37,10 @@
37 /*
38 ** Implementation of the /json/status page.
39 **
40 */
41 cson_value * json_page_status(){
 
42 Stmt q = empty_Stmt;
43 cson_object * oPay;
44 /*cson_object * files;*/
45 int vid, nErr = 0;
46 cson_object * tmpO;
@@ -101,11 +100,10 @@
100 " WHERE is_selected(id)"
101 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
102 );
103 while( db_step(&q)==SQLITE_ROW ){
104 const char *zPathname = db_column_text(&q,0);
 
105 int isDeleted = db_column_int(&q, 1);
106 int isChnged = db_column_int(&q,2);
107 int isNew = db_column_int(&q,3)==0;
108 int isRenamed = db_column_int(&q,4);
109 cson_object * oFile;
110
--- src/json_status.c
+++ src/json_status.c
@@ -37,11 +37,10 @@
3737
/*
3838
** Implementation of the /json/status page.
3939
**
4040
*/
4141
cson_value * json_page_status(){
42
- char const * zSql = NULL;
4342
Stmt q = empty_Stmt;
4443
cson_object * oPay;
4544
/*cson_object * files;*/
4645
int vid, nErr = 0;
4746
cson_object * tmpO;
@@ -101,11 +100,10 @@
101100
" WHERE is_selected(id)"
102101
" AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
103102
);
104103
while( db_step(&q)==SQLITE_ROW ){
105104
const char *zPathname = db_column_text(&q,0);
106
- const char *zDisplayName = zPathname;
107105
int isDeleted = db_column_int(&q, 1);
108106
int isChnged = db_column_int(&q,2);
109107
int isNew = db_column_int(&q,3)==0;
110108
int isRenamed = db_column_int(&q,4);
111109
cson_object * oFile;
112110
--- src/json_status.c
+++ src/json_status.c
@@ -37,11 +37,10 @@
37 /*
38 ** Implementation of the /json/status page.
39 **
40 */
41 cson_value * json_page_status(){
42 char const * zSql = NULL;
43 Stmt q = empty_Stmt;
44 cson_object * oPay;
45 /*cson_object * files;*/
46 int vid, nErr = 0;
47 cson_object * tmpO;
@@ -101,11 +100,10 @@
101 " WHERE is_selected(id)"
102 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
103 );
104 while( db_step(&q)==SQLITE_ROW ){
105 const char *zPathname = db_column_text(&q,0);
106 const char *zDisplayName = zPathname;
107 int isDeleted = db_column_int(&q, 1);
108 int isChnged = db_column_int(&q,2);
109 int isNew = db_column_int(&q,3)==0;
110 int isRenamed = db_column_int(&q,4);
111 cson_object * oFile;
112
--- src/json_status.c
+++ src/json_status.c
@@ -37,11 +37,10 @@
37 /*
38 ** Implementation of the /json/status page.
39 **
40 */
41 cson_value * json_page_status(){
 
42 Stmt q = empty_Stmt;
43 cson_object * oPay;
44 /*cson_object * files;*/
45 int vid, nErr = 0;
46 cson_object * tmpO;
@@ -101,11 +100,10 @@
100 " WHERE is_selected(id)"
101 " AND (chnged OR deleted OR rid=0 OR pathname!=origname) ORDER BY 1"
102 );
103 while( db_step(&q)==SQLITE_ROW ){
104 const char *zPathname = db_column_text(&q,0);
 
105 int isDeleted = db_column_int(&q, 1);
106 int isChnged = db_column_int(&q,2);
107 int isNew = db_column_int(&q,3)==0;
108 int isRenamed = db_column_int(&q,4);
109 cson_object * oFile;
110
+1 -2
--- src/main.c
+++ src/main.c
@@ -114,17 +114,16 @@
114114
char *nameOfExe; /* Full path of executable. */
115115
int isConst; /* True if the output is unchanging */
116116
sqlite3 *db; /* The connection to the databases */
117117
sqlite3 *dbConfig; /* Separate connection for global_config table */
118118
int useAttach; /* True if global_config is attached to repository */
119
- int configOpen; /* True if the config database is open */
119
+ const char *configDbName; /* Path of the config database. NULL if not open */
120120
sqlite3_int64 now; /* Seconds since 1970 */
121121
int repositoryOpen; /* True if the main repository database is open */
122122
char *zRepositoryName; /* Name of the repository database */
123123
const char *zMainDbType;/* "configdb", "localdb", or "repository" */
124124
const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
125
- const char *zHome; /* Name of user home directory */
126125
int localOpen; /* True if the local database is open */
127126
char *zLocalRoot; /* The directory holding the local database */
128127
int minPrefix; /* Number of digits needed for a distinct UUID */
129128
int fSqlTrace; /* True if --sqltrace flag is present */
130129
int fSqlStats; /* True if --sqltrace or --sqlstats are present */
131130
--- src/main.c
+++ src/main.c
@@ -114,17 +114,16 @@
114 char *nameOfExe; /* Full path of executable. */
115 int isConst; /* True if the output is unchanging */
116 sqlite3 *db; /* The connection to the databases */
117 sqlite3 *dbConfig; /* Separate connection for global_config table */
118 int useAttach; /* True if global_config is attached to repository */
119 int configOpen; /* True if the config database is open */
120 sqlite3_int64 now; /* Seconds since 1970 */
121 int repositoryOpen; /* True if the main repository database is open */
122 char *zRepositoryName; /* Name of the repository database */
123 const char *zMainDbType;/* "configdb", "localdb", or "repository" */
124 const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
125 const char *zHome; /* Name of user home directory */
126 int localOpen; /* True if the local database is open */
127 char *zLocalRoot; /* The directory holding the local database */
128 int minPrefix; /* Number of digits needed for a distinct UUID */
129 int fSqlTrace; /* True if --sqltrace flag is present */
130 int fSqlStats; /* True if --sqltrace or --sqlstats are present */
131
--- src/main.c
+++ src/main.c
@@ -114,17 +114,16 @@
114 char *nameOfExe; /* Full path of executable. */
115 int isConst; /* True if the output is unchanging */
116 sqlite3 *db; /* The connection to the databases */
117 sqlite3 *dbConfig; /* Separate connection for global_config table */
118 int useAttach; /* True if global_config is attached to repository */
119 const char *configDbName; /* Path of the config database. NULL if not open */
120 sqlite3_int64 now; /* Seconds since 1970 */
121 int repositoryOpen; /* True if the main repository database is open */
122 char *zRepositoryName; /* Name of the repository database */
123 const char *zMainDbType;/* "configdb", "localdb", or "repository" */
124 const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
 
125 int localOpen; /* True if the local database is open */
126 char *zLocalRoot; /* The directory holding the local database */
127 int minPrefix; /* Number of digits needed for a distinct UUID */
128 int fSqlTrace; /* True if --sqltrace flag is present */
129 int fSqlStats; /* True if --sqltrace or --sqlstats are present */
130
+1 -2
--- src/main.c
+++ src/main.c
@@ -114,17 +114,16 @@
114114
char *nameOfExe; /* Full path of executable. */
115115
int isConst; /* True if the output is unchanging */
116116
sqlite3 *db; /* The connection to the databases */
117117
sqlite3 *dbConfig; /* Separate connection for global_config table */
118118
int useAttach; /* True if global_config is attached to repository */
119
- int configOpen; /* True if the config database is open */
119
+ const char *configDbName; /* Path of the config database. NULL if not open */
120120
sqlite3_int64 now; /* Seconds since 1970 */
121121
int repositoryOpen; /* True if the main repository database is open */
122122
char *zRepositoryName; /* Name of the repository database */
123123
const char *zMainDbType;/* "configdb", "localdb", or "repository" */
124124
const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
125
- const char *zHome; /* Name of user home directory */
126125
int localOpen; /* True if the local database is open */
127126
char *zLocalRoot; /* The directory holding the local database */
128127
int minPrefix; /* Number of digits needed for a distinct UUID */
129128
int fSqlTrace; /* True if --sqltrace flag is present */
130129
int fSqlStats; /* True if --sqltrace or --sqlstats are present */
131130
--- src/main.c
+++ src/main.c
@@ -114,17 +114,16 @@
114 char *nameOfExe; /* Full path of executable. */
115 int isConst; /* True if the output is unchanging */
116 sqlite3 *db; /* The connection to the databases */
117 sqlite3 *dbConfig; /* Separate connection for global_config table */
118 int useAttach; /* True if global_config is attached to repository */
119 int configOpen; /* True if the config database is open */
120 sqlite3_int64 now; /* Seconds since 1970 */
121 int repositoryOpen; /* True if the main repository database is open */
122 char *zRepositoryName; /* Name of the repository database */
123 const char *zMainDbType;/* "configdb", "localdb", or "repository" */
124 const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
125 const char *zHome; /* Name of user home directory */
126 int localOpen; /* True if the local database is open */
127 char *zLocalRoot; /* The directory holding the local database */
128 int minPrefix; /* Number of digits needed for a distinct UUID */
129 int fSqlTrace; /* True if --sqltrace flag is present */
130 int fSqlStats; /* True if --sqltrace or --sqlstats are present */
131
--- src/main.c
+++ src/main.c
@@ -114,17 +114,16 @@
114 char *nameOfExe; /* Full path of executable. */
115 int isConst; /* True if the output is unchanging */
116 sqlite3 *db; /* The connection to the databases */
117 sqlite3 *dbConfig; /* Separate connection for global_config table */
118 int useAttach; /* True if global_config is attached to repository */
119 const char *configDbName; /* Path of the config database. NULL if not open */
120 sqlite3_int64 now; /* Seconds since 1970 */
121 int repositoryOpen; /* True if the main repository database is open */
122 char *zRepositoryName; /* Name of the repository database */
123 const char *zMainDbType;/* "configdb", "localdb", or "repository" */
124 const char *zConfigDbType; /* "configdb", "localdb", or "repository" */
 
125 int localOpen; /* True if the local database is open */
126 char *zLocalRoot; /* The directory holding the local database */
127 int minPrefix; /* Number of digits needed for a distinct UUID */
128 int fSqlTrace; /* True if --sqltrace flag is present */
129 int fSqlStats; /* True if --sqltrace or --sqlstats are present */
130
+1 -1
--- src/setup.c
+++ src/setup.c
@@ -1678,11 +1678,11 @@
16781678
@
16791679
@ <p>Only a the first statement in the entry box will be run.
16801680
@ Any subsequent statements will be silently ignored.</p>
16811681
@
16821682
@ <p>Database names:<ul><li>repository &rarr; %s(db_name("repository"))
1683
- if( g.configOpen ){
1683
+ if( g.configDbName ){
16841684
@ <li>config &rarr; %s(db_name("configdb"))
16851685
}
16861686
if( g.localOpen ){
16871687
@ <li>local-checkout &rarr; %s(db_name("localdb"))
16881688
}
16891689
--- src/setup.c
+++ src/setup.c
@@ -1678,11 +1678,11 @@
1678 @
1679 @ <p>Only a the first statement in the entry box will be run.
1680 @ Any subsequent statements will be silently ignored.</p>
1681 @
1682 @ <p>Database names:<ul><li>repository &rarr; %s(db_name("repository"))
1683 if( g.configOpen ){
1684 @ <li>config &rarr; %s(db_name("configdb"))
1685 }
1686 if( g.localOpen ){
1687 @ <li>local-checkout &rarr; %s(db_name("localdb"))
1688 }
1689
--- src/setup.c
+++ src/setup.c
@@ -1678,11 +1678,11 @@
1678 @
1679 @ <p>Only a the first statement in the entry box will be run.
1680 @ Any subsequent statements will be silently ignored.</p>
1681 @
1682 @ <p>Database names:<ul><li>repository &rarr; %s(db_name("repository"))
1683 if( g.configDbName ){
1684 @ <li>config &rarr; %s(db_name("configdb"))
1685 }
1686 if( g.localOpen ){
1687 @ <li>local-checkout &rarr; %s(db_name("localdb"))
1688 }
1689
+1 -1
--- src/setup.c
+++ src/setup.c
@@ -1678,11 +1678,11 @@
16781678
@
16791679
@ <p>Only a the first statement in the entry box will be run.
16801680
@ Any subsequent statements will be silently ignored.</p>
16811681
@
16821682
@ <p>Database names:<ul><li>repository &rarr; %s(db_name("repository"))
1683
- if( g.configOpen ){
1683
+ if( g.configDbName ){
16841684
@ <li>config &rarr; %s(db_name("configdb"))
16851685
}
16861686
if( g.localOpen ){
16871687
@ <li>local-checkout &rarr; %s(db_name("localdb"))
16881688
}
16891689
--- src/setup.c
+++ src/setup.c
@@ -1678,11 +1678,11 @@
1678 @
1679 @ <p>Only a the first statement in the entry box will be run.
1680 @ Any subsequent statements will be silently ignored.</p>
1681 @
1682 @ <p>Database names:<ul><li>repository &rarr; %s(db_name("repository"))
1683 if( g.configOpen ){
1684 @ <li>config &rarr; %s(db_name("configdb"))
1685 }
1686 if( g.localOpen ){
1687 @ <li>local-checkout &rarr; %s(db_name("localdb"))
1688 }
1689
--- src/setup.c
+++ src/setup.c
@@ -1678,11 +1678,11 @@
1678 @
1679 @ <p>Only a the first statement in the entry box will be run.
1680 @ Any subsequent statements will be silently ignored.</p>
1681 @
1682 @ <p>Database names:<ul><li>repository &rarr; %s(db_name("repository"))
1683 if( g.configDbName ){
1684 @ <li>config &rarr; %s(db_name("configdb"))
1685 }
1686 if( g.localOpen ){
1687 @ <li>local-checkout &rarr; %s(db_name("localdb"))
1688 }
1689

Keyboard Shortcuts

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