Fossil SCM

style: use g.zConfigDbName in stead of g.configDbName, as all other strings.

jan.nijtmans 2013-03-05 12:25 trunk
Commit a5dc5332d4d948bb25da296396b169e5ffbca35e
+2 -2
--- src/checkin.c
+++ src/checkin.c
@@ -203,12 +203,12 @@
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);
208
+ if( g.zConfigDbName ){
209
+ fossil_print("config-db: %s\n", g.zConfigDbName);
210210
}
211211
vid = db_lget_int("checkout", 0);
212212
if( vid ){
213213
show_common_info(vid, "checkout:", 1, 1);
214214
}
215215
--- src/checkin.c
+++ src/checkin.c
@@ -203,12 +203,12 @@
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
--- src/checkin.c
+++ src/checkin.c
@@ -203,12 +203,12 @@
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.zConfigDbName ){
209 fossil_print("config-db: %s\n", g.zConfigDbName);
210 }
211 vid = db_lget_int("checkout", 0);
212 if( vid ){
213 show_common_info(vid, "checkout:", 1, 1);
214 }
215
+6 -6
--- 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.configDbName ) return;
797
+ if( g.zConfigDbName ) 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 ){
@@ -844,11 +844,11 @@
844844
}else{
845845
g.useAttach = 0;
846846
g.dbConfig = db_open(zDbName);
847847
g.zConfigDbType = "configdb";
848848
}
849
- g.configDbName = zDbName;
849
+ g.zConfigDbName = zDbName;
850850
}
851851
852852
853853
/*
854854
** Returns TRUE if zTable exists in the local database but lacks column
@@ -1204,11 +1204,11 @@
12041204
fossil_warning("unfinalized SQL statement: [%s]", sqlite3_sql(pStmt));
12051205
}
12061206
}
12071207
g.repositoryOpen = 0;
12081208
g.localOpen = 0;
1209
- g.configDbName = NULL;
1209
+ g.zConfigDbName = NULL;
12101210
sqlite3_wal_checkpoint(g.db, 0);
12111211
sqlite3_close(g.db);
12121212
g.db = 0;
12131213
g.zMainDbType = 0;
12141214
if( g.dbConfig ){
@@ -1767,11 +1767,11 @@
17671767
}
17681768
}
17691769
if( g.repositoryOpen ){
17701770
z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
17711771
}
1772
- if( z==0 && g.configDbName ){
1772
+ if( z==0 && g.zConfigDbName ){
17731773
db_swap_connections();
17741774
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
17751775
db_swap_connections();
17761776
}
17771777
if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
@@ -1814,11 +1814,11 @@
18141814
}
18151815
db_end_transaction(0);
18161816
}
18171817
int db_is_global(const char *zName){
18181818
int rc = 0;
1819
- if( g.configDbName ){
1819
+ if( g.zConfigDbName ){
18201820
db_swap_connections();
18211821
rc = db_exists("SELECT 1 FROM global_config WHERE name=%Q", zName);
18221822
db_swap_connections();
18231823
}
18241824
return rc;
@@ -1835,11 +1835,11 @@
18351835
}
18361836
db_finalize(&q);
18371837
}else{
18381838
rc = SQLITE_DONE;
18391839
}
1840
- if( rc==SQLITE_DONE && g.configDbName ){
1840
+ if( rc==SQLITE_DONE && g.zConfigDbName ){
18411841
db_swap_connections();
18421842
v = db_int(dflt, "SELECT value FROM global_config WHERE name=%Q", zName);
18431843
db_swap_connections();
18441844
}
18451845
return v;
18461846
--- 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 ){
@@ -844,11 +844,11 @@
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
@@ -1204,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 ){
@@ -1767,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 ){
@@ -1814,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;
@@ -1835,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
--- 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.zConfigDbName ) 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 ){
@@ -844,11 +844,11 @@
844 }else{
845 g.useAttach = 0;
846 g.dbConfig = db_open(zDbName);
847 g.zConfigDbType = "configdb";
848 }
849 g.zConfigDbName = zDbName;
850 }
851
852
853 /*
854 ** Returns TRUE if zTable exists in the local database but lacks column
@@ -1204,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.zConfigDbName = 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 ){
@@ -1767,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.zConfigDbName ){
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 ){
@@ -1814,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.zConfigDbName ){
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;
@@ -1835,11 +1835,11 @@
1835 }
1836 db_finalize(&q);
1837 }else{
1838 rc = SQLITE_DONE;
1839 }
1840 if( rc==SQLITE_DONE && g.zConfigDbName ){
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 -2
--- src/info.c
+++ src/info.c
@@ -198,12 +198,12 @@
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( g.configDbName ){
204
- fossil_print("config-db: %s\n", g.configDbName);
203
+ if( g.zConfigDbName ){
204
+ fossil_print("config-db: %s\n", g.zConfigDbName);
205205
}
206206
fossil_print("project-code: %s\n", db_get("project-code", ""));
207207
vid = g.localOpen ? db_lget_int("checkout", 0) : 0;
208208
if( vid ){
209209
show_common_info(vid, "checkout:", 1, 1);
210210
--- src/info.c
+++ src/info.c
@@ -198,12 +198,12 @@
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
--- src/info.c
+++ src/info.c
@@ -198,12 +198,12 @@
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.zConfigDbName ){
204 fossil_print("config-db: %s\n", g.zConfigDbName);
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
+1 -1
--- 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
- CSTR(g, configDbName);
1377
+ CSTR(g, zConfigDbName);
13781378
INT(g, repositoryOpen);
13791379
INT(g, localOpen);
13801380
INT(g, minPrefix);
13811381
INT(g, fSqlTrace);
13821382
INT(g, fSqlStats);
13831383
--- 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);
1383
--- 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, zConfigDbName);
1378 INT(g, repositoryOpen);
1379 INT(g, localOpen);
1380 INT(g, minPrefix);
1381 INT(g, fSqlTrace);
1382 INT(g, fSqlStats);
1383
+1 -1
--- src/main.c
+++ src/main.c
@@ -114,11 +114,11 @@
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
- const char *configDbName; /* Path of the config database. NULL if not open */
119
+ const char *zConfigDbName;/* 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" */
125125
--- src/main.c
+++ src/main.c
@@ -114,11 +114,11 @@
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
--- src/main.c
+++ src/main.c
@@ -114,11 +114,11 @@
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 *zConfigDbName;/* 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
+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.configDbName ){
1683
+ if( g.zConfigDbName ){
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.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
--- 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.zConfigDbName ){
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