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.
Commit
4778edd3f2c8e529f940b8bbcbc9431e339af8e6
Parent
0317a929cb7a40a…
6 files changed
+2
-2
+2
-2
+1
-1
+1
-1
+1
+1
-1
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1438,11 +1438,11 @@ | ||
| 1438 | 1438 | } |
| 1439 | 1439 | cacheEntry = cacheEntry->next; |
| 1440 | 1440 | } |
| 1441 | 1441 | /* Attempt to read value from file in checkout if there wasn't a cache hit |
| 1442 | 1442 | ** and a checkout is open. */ |
| 1443 | - if( cacheEntry==0 && db_open_local() ){ | |
| 1443 | + if( cacheEntry==0 ){ | |
| 1444 | 1444 | Blob versionedPathname; |
| 1445 | 1445 | char *zVersionedPathname; |
| 1446 | 1446 | blob_zero(&versionedPathname); |
| 1447 | 1447 | blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", |
| 1448 | 1448 | g.zLocalRoot, zName); |
| @@ -1512,11 +1512,11 @@ | ||
| 1512 | 1512 | if( z==0 && g.configOpen ){ |
| 1513 | 1513 | db_swap_connections(); |
| 1514 | 1514 | z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName); |
| 1515 | 1515 | db_swap_connections(); |
| 1516 | 1516 | } |
| 1517 | - if( ctrlSetting!=0 && ctrlSetting->versionable ){ | |
| 1517 | + if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){ | |
| 1518 | 1518 | /* This is a versionable setting, try and get the info from a checked out file */ |
| 1519 | 1519 | z = db_get_do_versionable(zName, z); |
| 1520 | 1520 | } |
| 1521 | 1521 | if( z==0 ){ |
| 1522 | 1522 | z = zDefault; |
| 1523 | 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 && 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 |
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1438,11 +1438,11 @@ | ||
| 1438 | 1438 | } |
| 1439 | 1439 | cacheEntry = cacheEntry->next; |
| 1440 | 1440 | } |
| 1441 | 1441 | /* Attempt to read value from file in checkout if there wasn't a cache hit |
| 1442 | 1442 | ** and a checkout is open. */ |
| 1443 | - if( cacheEntry==0 && db_open_local() ){ | |
| 1443 | + if( cacheEntry==0 ){ | |
| 1444 | 1444 | Blob versionedPathname; |
| 1445 | 1445 | char *zVersionedPathname; |
| 1446 | 1446 | blob_zero(&versionedPathname); |
| 1447 | 1447 | blob_appendf(&versionedPathname, "%s/.fossil-settings/%s", |
| 1448 | 1448 | g.zLocalRoot, zName); |
| @@ -1512,11 +1512,11 @@ | ||
| 1512 | 1512 | if( z==0 && g.configOpen ){ |
| 1513 | 1513 | db_swap_connections(); |
| 1514 | 1514 | z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName); |
| 1515 | 1515 | db_swap_connections(); |
| 1516 | 1516 | } |
| 1517 | - if( ctrlSetting!=0 && ctrlSetting->versionable ){ | |
| 1517 | + if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){ | |
| 1518 | 1518 | /* This is a versionable setting, try and get the info from a checked out file */ |
| 1519 | 1519 | z = db_get_do_versionable(zName, z); |
| 1520 | 1520 | } |
| 1521 | 1521 | if( z==0 ){ |
| 1522 | 1522 | z = zDefault; |
| 1523 | 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 && 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 @@ | ||
| 287 | 287 | diff_printf("ADDED_BY_MERGE %s\n", zPathname); |
| 288 | 288 | srcid = 0; |
| 289 | 289 | if( !asNewFile ){ showDiff = 0; } |
| 290 | 290 | } |
| 291 | 291 | if( showDiff ){ |
| 292 | + Blob content; | |
| 292 | 293 | if( !isLink != !file_islink(zFullName) ){ |
| 293 | 294 | diff_print_index(zPathname); |
| 294 | 295 | diff_printf("--- %s\n+++ %s\n", zPathname, zPathname); |
| 295 | 296 | diff_printf("cannot compute difference between symlink and regular file\n"); |
| 296 | 297 | continue; |
| 297 | 298 | } |
| 298 | - Blob content; | |
| 299 | 299 | if( srcid>0 ){ |
| 300 | 300 | content_get(srcid, &content); |
| 301 | 301 | }else{ |
| 302 | 302 | blob_zero(&content); |
| 303 | 303 | } |
| 304 | 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 | 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 @@ | ||
| 287 | 287 | diff_printf("ADDED_BY_MERGE %s\n", zPathname); |
| 288 | 288 | srcid = 0; |
| 289 | 289 | if( !asNewFile ){ showDiff = 0; } |
| 290 | 290 | } |
| 291 | 291 | if( showDiff ){ |
| 292 | + Blob content; | |
| 292 | 293 | if( !isLink != !file_islink(zFullName) ){ |
| 293 | 294 | diff_print_index(zPathname); |
| 294 | 295 | diff_printf("--- %s\n+++ %s\n", zPathname, zPathname); |
| 295 | 296 | diff_printf("cannot compute difference between symlink and regular file\n"); |
| 296 | 297 | continue; |
| 297 | 298 | } |
| 298 | - Blob content; | |
| 299 | 299 | if( srcid>0 ){ |
| 300 | 300 | content_get(srcid, &content); |
| 301 | 301 | }else{ |
| 302 | 302 | blob_zero(&content); |
| 303 | 303 | } |
| 304 | 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 | 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
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1050,10 +1050,11 @@ | ||
| 1050 | 1050 | if( !g.okSetup ){ |
| 1051 | 1051 | login_needed(); |
| 1052 | 1052 | } |
| 1053 | 1053 | |
| 1054 | 1054 | style_header("Settings"); |
| 1055 | + db_open_local(); | |
| 1055 | 1056 | db_begin_transaction(); |
| 1056 | 1057 | @ <p>This page provides a simple interface to the "fossil setting" command. |
| 1057 | 1058 | @ See the "fossil help setting" output below for further information on |
| 1058 | 1059 | @ the meaning of each setting.</p><hr /> |
| 1059 | 1060 | @ <form action="%s(g.zTop)/setup_settings" method="post"><div> |
| 1060 | 1061 |
| --- 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 @@ | ||
| 1259 | 1259 | */ |
| 1260 | 1260 | void print_timeline(Stmt *q, int mxLine, int showfiles){ |
| 1261 | 1261 | int nLine = 0; |
| 1262 | 1262 | char zPrevDate[20]; |
| 1263 | 1263 | const char *zCurrentUuid=0; |
| 1264 | - zPrevDate[0] = 0; | |
| 1265 | 1264 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 1266 | 1265 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 1266 | + zPrevDate[0] = 0; | |
| 1267 | 1267 | |
| 1268 | 1268 | if( g.localOpen ){ |
| 1269 | 1269 | int rid = db_lget_int("checkout", 0); |
| 1270 | 1270 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1271 | 1271 | } |
| 1272 | 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 | 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 |