Fossil SCM

Fix a C89 error specific to the symlinks branch and also pull in the C89 fix and the versionable settings fix from trunk.

drh 2011-08-27 18:12 symlinks merge
Commit 4778edd3f2c8e529f940b8bbcbc9431e339af8e6
+2 -2
--- src/db.c
+++ src/db.c
@@ -1438,11 +1438,11 @@
14381438
}
14391439
cacheEntry = cacheEntry->next;
14401440
}
14411441
/* Attempt to read value from file in checkout if there wasn't a cache hit
14421442
** and a checkout is open. */
1443
- if( cacheEntry==0 && db_open_local() ){
1443
+ if( cacheEntry==0 ){
14441444
Blob versionedPathname;
14451445
char *zVersionedPathname;
14461446
blob_zero(&versionedPathname);
14471447
blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
14481448
g.zLocalRoot, zName);
@@ -1512,11 +1512,11 @@
15121512
if( z==0 && g.configOpen ){
15131513
db_swap_connections();
15141514
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
15151515
db_swap_connections();
15161516
}
1517
- if( ctrlSetting!=0 && ctrlSetting->versionable ){
1517
+ if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
15181518
/* This is a versionable setting, try and get the info from a checked out file */
15191519
z = db_get_do_versionable(zName, z);
15201520
}
15211521
if( z==0 ){
15221522
z = zDefault;
15231523
--- src/db.c
+++ src/db.c
@@ -1438,11 +1438,11 @@
1438 }
1439 cacheEntry = cacheEntry->next;
1440 }
1441 /* Attempt to read value from file in checkout if there wasn't a cache hit
1442 ** and a checkout is open. */
1443 if( cacheEntry==0 && db_open_local() ){
1444 Blob versionedPathname;
1445 char *zVersionedPathname;
1446 blob_zero(&versionedPathname);
1447 blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
1448 g.zLocalRoot, zName);
@@ -1512,11 +1512,11 @@
1512 if( z==0 && g.configOpen ){
1513 db_swap_connections();
1514 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1515 db_swap_connections();
1516 }
1517 if( ctrlSetting!=0 && ctrlSetting->versionable ){
1518 /* This is a versionable setting, try and get the info from a checked out file */
1519 z = db_get_do_versionable(zName, z);
1520 }
1521 if( z==0 ){
1522 z = zDefault;
1523
--- src/db.c
+++ src/db.c
@@ -1438,11 +1438,11 @@
1438 }
1439 cacheEntry = cacheEntry->next;
1440 }
1441 /* Attempt to read value from file in checkout if there wasn't a cache hit
1442 ** and a checkout is open. */
1443 if( cacheEntry==0 ){
1444 Blob versionedPathname;
1445 char *zVersionedPathname;
1446 blob_zero(&versionedPathname);
1447 blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
1448 g.zLocalRoot, zName);
@@ -1512,11 +1512,11 @@
1512 if( z==0 && g.configOpen ){
1513 db_swap_connections();
1514 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1515 db_swap_connections();
1516 }
1517 if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
1518 /* This is a versionable setting, try and get the info from a checked out file */
1519 z = db_get_do_versionable(zName, z);
1520 }
1521 if( z==0 ){
1522 z = zDefault;
1523
+2 -2
--- src/db.c
+++ src/db.c
@@ -1438,11 +1438,11 @@
14381438
}
14391439
cacheEntry = cacheEntry->next;
14401440
}
14411441
/* Attempt to read value from file in checkout if there wasn't a cache hit
14421442
** and a checkout is open. */
1443
- if( cacheEntry==0 && db_open_local() ){
1443
+ if( cacheEntry==0 ){
14441444
Blob versionedPathname;
14451445
char *zVersionedPathname;
14461446
blob_zero(&versionedPathname);
14471447
blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
14481448
g.zLocalRoot, zName);
@@ -1512,11 +1512,11 @@
15121512
if( z==0 && g.configOpen ){
15131513
db_swap_connections();
15141514
z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
15151515
db_swap_connections();
15161516
}
1517
- if( ctrlSetting!=0 && ctrlSetting->versionable ){
1517
+ if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
15181518
/* This is a versionable setting, try and get the info from a checked out file */
15191519
z = db_get_do_versionable(zName, z);
15201520
}
15211521
if( z==0 ){
15221522
z = zDefault;
15231523
--- src/db.c
+++ src/db.c
@@ -1438,11 +1438,11 @@
1438 }
1439 cacheEntry = cacheEntry->next;
1440 }
1441 /* Attempt to read value from file in checkout if there wasn't a cache hit
1442 ** and a checkout is open. */
1443 if( cacheEntry==0 && db_open_local() ){
1444 Blob versionedPathname;
1445 char *zVersionedPathname;
1446 blob_zero(&versionedPathname);
1447 blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
1448 g.zLocalRoot, zName);
@@ -1512,11 +1512,11 @@
1512 if( z==0 && g.configOpen ){
1513 db_swap_connections();
1514 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1515 db_swap_connections();
1516 }
1517 if( ctrlSetting!=0 && ctrlSetting->versionable ){
1518 /* This is a versionable setting, try and get the info from a checked out file */
1519 z = db_get_do_versionable(zName, z);
1520 }
1521 if( z==0 ){
1522 z = zDefault;
1523
--- src/db.c
+++ src/db.c
@@ -1438,11 +1438,11 @@
1438 }
1439 cacheEntry = cacheEntry->next;
1440 }
1441 /* Attempt to read value from file in checkout if there wasn't a cache hit
1442 ** and a checkout is open. */
1443 if( cacheEntry==0 ){
1444 Blob versionedPathname;
1445 char *zVersionedPathname;
1446 blob_zero(&versionedPathname);
1447 blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
1448 g.zLocalRoot, zName);
@@ -1512,11 +1512,11 @@
1512 if( z==0 && g.configOpen ){
1513 db_swap_connections();
1514 z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
1515 db_swap_connections();
1516 }
1517 if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
1518 /* This is a versionable setting, try and get the info from a checked out file */
1519 z = db_get_do_versionable(zName, z);
1520 }
1521 if( z==0 ){
1522 z = zDefault;
1523
+1 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,17 +287,17 @@
287287
diff_printf("ADDED_BY_MERGE %s\n", zPathname);
288288
srcid = 0;
289289
if( !asNewFile ){ showDiff = 0; }
290290
}
291291
if( showDiff ){
292
+ Blob content;
292293
if( !isLink != !file_islink(zFullName) ){
293294
diff_print_index(zPathname);
294295
diff_printf("--- %s\n+++ %s\n", zPathname, zPathname);
295296
diff_printf("cannot compute difference between symlink and regular file\n");
296297
continue;
297298
}
298
- Blob content;
299299
if( srcid>0 ){
300300
content_get(srcid, &content);
301301
}else{
302302
blob_zero(&content);
303303
}
304304
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,17 +287,17 @@
287 diff_printf("ADDED_BY_MERGE %s\n", zPathname);
288 srcid = 0;
289 if( !asNewFile ){ showDiff = 0; }
290 }
291 if( showDiff ){
 
292 if( !isLink != !file_islink(zFullName) ){
293 diff_print_index(zPathname);
294 diff_printf("--- %s\n+++ %s\n", zPathname, zPathname);
295 diff_printf("cannot compute difference between symlink and regular file\n");
296 continue;
297 }
298 Blob content;
299 if( srcid>0 ){
300 content_get(srcid, &content);
301 }else{
302 blob_zero(&content);
303 }
304
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,17 +287,17 @@
287 diff_printf("ADDED_BY_MERGE %s\n", zPathname);
288 srcid = 0;
289 if( !asNewFile ){ showDiff = 0; }
290 }
291 if( showDiff ){
292 Blob content;
293 if( !isLink != !file_islink(zFullName) ){
294 diff_print_index(zPathname);
295 diff_printf("--- %s\n+++ %s\n", zPathname, zPathname);
296 diff_printf("cannot compute difference between symlink and regular file\n");
297 continue;
298 }
 
299 if( srcid>0 ){
300 content_get(srcid, &content);
301 }else{
302 blob_zero(&content);
303 }
304
+1 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,17 +287,17 @@
287287
diff_printf("ADDED_BY_MERGE %s\n", zPathname);
288288
srcid = 0;
289289
if( !asNewFile ){ showDiff = 0; }
290290
}
291291
if( showDiff ){
292
+ Blob content;
292293
if( !isLink != !file_islink(zFullName) ){
293294
diff_print_index(zPathname);
294295
diff_printf("--- %s\n+++ %s\n", zPathname, zPathname);
295296
diff_printf("cannot compute difference between symlink and regular file\n");
296297
continue;
297298
}
298
- Blob content;
299299
if( srcid>0 ){
300300
content_get(srcid, &content);
301301
}else{
302302
blob_zero(&content);
303303
}
304304
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,17 +287,17 @@
287 diff_printf("ADDED_BY_MERGE %s\n", zPathname);
288 srcid = 0;
289 if( !asNewFile ){ showDiff = 0; }
290 }
291 if( showDiff ){
 
292 if( !isLink != !file_islink(zFullName) ){
293 diff_print_index(zPathname);
294 diff_printf("--- %s\n+++ %s\n", zPathname, zPathname);
295 diff_printf("cannot compute difference between symlink and regular file\n");
296 continue;
297 }
298 Blob content;
299 if( srcid>0 ){
300 content_get(srcid, &content);
301 }else{
302 blob_zero(&content);
303 }
304
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -287,17 +287,17 @@
287 diff_printf("ADDED_BY_MERGE %s\n", zPathname);
288 srcid = 0;
289 if( !asNewFile ){ showDiff = 0; }
290 }
291 if( showDiff ){
292 Blob content;
293 if( !isLink != !file_islink(zFullName) ){
294 diff_print_index(zPathname);
295 diff_printf("--- %s\n+++ %s\n", zPathname, zPathname);
296 diff_printf("cannot compute difference between symlink and regular file\n");
297 continue;
298 }
 
299 if( srcid>0 ){
300 content_get(srcid, &content);
301 }else{
302 blob_zero(&content);
303 }
304
--- src/setup.c
+++ src/setup.c
@@ -1050,10 +1050,11 @@
10501050
if( !g.okSetup ){
10511051
login_needed();
10521052
}
10531053
10541054
style_header("Settings");
1055
+ db_open_local();
10551056
db_begin_transaction();
10561057
@ <p>This page provides a simple interface to the "fossil setting" command.
10571058
@ See the "fossil help setting" output below for further information on
10581059
@ the meaning of each setting.</p><hr />
10591060
@ <form action="%s(g.zTop)/setup_settings" method="post"><div>
10601061
--- src/setup.c
+++ src/setup.c
@@ -1050,10 +1050,11 @@
1050 if( !g.okSetup ){
1051 login_needed();
1052 }
1053
1054 style_header("Settings");
 
1055 db_begin_transaction();
1056 @ <p>This page provides a simple interface to the "fossil setting" command.
1057 @ See the "fossil help setting" output below for further information on
1058 @ the meaning of each setting.</p><hr />
1059 @ <form action="%s(g.zTop)/setup_settings" method="post"><div>
1060
--- src/setup.c
+++ src/setup.c
@@ -1050,10 +1050,11 @@
1050 if( !g.okSetup ){
1051 login_needed();
1052 }
1053
1054 style_header("Settings");
1055 db_open_local();
1056 db_begin_transaction();
1057 @ <p>This page provides a simple interface to the "fossil setting" command.
1058 @ See the "fossil help setting" output below for further information on
1059 @ the meaning of each setting.</p><hr />
1060 @ <form action="%s(g.zTop)/setup_settings" method="post"><div>
1061
+1 -1
--- src/timeline.c
+++ src/timeline.c
@@ -1259,13 +1259,13 @@
12591259
*/
12601260
void print_timeline(Stmt *q, int mxLine, int showfiles){
12611261
int nLine = 0;
12621262
char zPrevDate[20];
12631263
const char *zCurrentUuid=0;
1264
- zPrevDate[0] = 0;
12651264
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
12661265
Stmt fchngQuery; /* Query for file changes on check-ins */
1266
+ zPrevDate[0] = 0;
12671267
12681268
if( g.localOpen ){
12691269
int rid = db_lget_int("checkout", 0);
12701270
zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
12711271
}
12721272
--- src/timeline.c
+++ src/timeline.c
@@ -1259,13 +1259,13 @@
1259 */
1260 void print_timeline(Stmt *q, int mxLine, int showfiles){
1261 int nLine = 0;
1262 char zPrevDate[20];
1263 const char *zCurrentUuid=0;
1264 zPrevDate[0] = 0;
1265 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
1266 Stmt fchngQuery; /* Query for file changes on check-ins */
 
1267
1268 if( g.localOpen ){
1269 int rid = db_lget_int("checkout", 0);
1270 zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
1271 }
1272
--- src/timeline.c
+++ src/timeline.c
@@ -1259,13 +1259,13 @@
1259 */
1260 void print_timeline(Stmt *q, int mxLine, int showfiles){
1261 int nLine = 0;
1262 char zPrevDate[20];
1263 const char *zCurrentUuid=0;
 
1264 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
1265 Stmt fchngQuery; /* Query for file changes on check-ins */
1266 zPrevDate[0] = 0;
1267
1268 if( g.localOpen ){
1269 int rid = db_lget_int("checkout", 0);
1270 zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
1271 }
1272

Keyboard Shortcuts

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