Fossil SCM

Catch up with recent changes on trunk.

drh 2015-05-18 17:53 UTC andygoth-user-reports merge
Commit 991f4b98f65221379cc42bb08493053e1d4bc31b
+1 -1
--- src/blob.c
+++ src/blob.c
@@ -838,11 +838,11 @@
838838
#if defined(_WIN32)
839839
fflush(stdout);
840840
_setmode(_fileno(stdout), _O_TEXT);
841841
#endif
842842
}else{
843
- file_mkfolder(zFilename, 1);
843
+ file_mkfolder(zFilename, 1, 0);
844844
out = fossil_fopen(zFilename, "wb");
845845
if( out==0 ){
846846
fossil_fatal_recursive("unable to open file \"%s\" for writing",
847847
zFilename);
848848
return 0;
849849
--- src/blob.c
+++ src/blob.c
@@ -838,11 +838,11 @@
838 #if defined(_WIN32)
839 fflush(stdout);
840 _setmode(_fileno(stdout), _O_TEXT);
841 #endif
842 }else{
843 file_mkfolder(zFilename, 1);
844 out = fossil_fopen(zFilename, "wb");
845 if( out==0 ){
846 fossil_fatal_recursive("unable to open file \"%s\" for writing",
847 zFilename);
848 return 0;
849
--- src/blob.c
+++ src/blob.c
@@ -838,11 +838,11 @@
838 #if defined(_WIN32)
839 fflush(stdout);
840 _setmode(_fileno(stdout), _O_TEXT);
841 #endif
842 }else{
843 file_mkfolder(zFilename, 1, 0);
844 out = fossil_fopen(zFilename, "wb");
845 if( out==0 ){
846 fossil_fatal_recursive("unable to open file \"%s\" for writing",
847 zFilename);
848 return 0;
849
-4
--- src/db.c
+++ src/db.c
@@ -2217,12 +2217,10 @@
22172217
void cmd_open(void){
22182218
int emptyFlag;
22192219
int keepFlag;
22202220
int forceMissingFlag;
22212221
int allowNested;
2222
- char **oldArgv;
2223
- int oldArgc;
22242222
static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0, 0 };
22252223
22262224
url_proxy_options();
22272225
emptyFlag = find_option("empty",0,0)!=0;
22282226
keepFlag = find_option("keep",0,0)!=0;
@@ -2268,12 +2266,10 @@
22682266
db_delete_on_failure(LOCALDB_NAME);
22692267
db_open_local(0);
22702268
db_lset("repository", g.argv[2]);
22712269
db_record_repository_filename(g.argv[2]);
22722270
db_lset_int("checkout", 0);
2273
- oldArgv = g.argv;
2274
- oldArgc = g.argc;
22752271
azNewArgv[0] = g.argv[0];
22762272
g.argv = azNewArgv;
22772273
if( !emptyFlag ){
22782274
g.argc = 3;
22792275
if( g.zOpenRevision ){
22802276
--- src/db.c
+++ src/db.c
@@ -2217,12 +2217,10 @@
2217 void cmd_open(void){
2218 int emptyFlag;
2219 int keepFlag;
2220 int forceMissingFlag;
2221 int allowNested;
2222 char **oldArgv;
2223 int oldArgc;
2224 static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0, 0 };
2225
2226 url_proxy_options();
2227 emptyFlag = find_option("empty",0,0)!=0;
2228 keepFlag = find_option("keep",0,0)!=0;
@@ -2268,12 +2266,10 @@
2268 db_delete_on_failure(LOCALDB_NAME);
2269 db_open_local(0);
2270 db_lset("repository", g.argv[2]);
2271 db_record_repository_filename(g.argv[2]);
2272 db_lset_int("checkout", 0);
2273 oldArgv = g.argv;
2274 oldArgc = g.argc;
2275 azNewArgv[0] = g.argv[0];
2276 g.argv = azNewArgv;
2277 if( !emptyFlag ){
2278 g.argc = 3;
2279 if( g.zOpenRevision ){
2280
--- src/db.c
+++ src/db.c
@@ -2217,12 +2217,10 @@
2217 void cmd_open(void){
2218 int emptyFlag;
2219 int keepFlag;
2220 int forceMissingFlag;
2221 int allowNested;
 
 
2222 static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0, 0 };
2223
2224 url_proxy_options();
2225 emptyFlag = find_option("empty",0,0)!=0;
2226 keepFlag = find_option("keep",0,0)!=0;
@@ -2268,12 +2266,10 @@
2266 db_delete_on_failure(LOCALDB_NAME);
2267 db_open_local(0);
2268 db_lset("repository", g.argv[2]);
2269 db_record_repository_filename(g.argv[2]);
2270 db_lset_int("checkout", 0);
 
 
2271 azNewArgv[0] = g.argv[0];
2272 g.argv = azNewArgv;
2273 if( !emptyFlag ){
2274 g.argc = 3;
2275 if( g.zOpenRevision ){
2276
+12 -5
--- src/file.c
+++ src/file.c
@@ -386,11 +386,11 @@
386386
FILE *in, *out;
387387
int got;
388388
char zBuf[8192];
389389
in = fossil_fopen(zFrom, "rb");
390390
if( in==0 ) fossil_fatal("cannot open \"%s\" for reading", zFrom);
391
- file_mkfolder(zTo, 0);
391
+ file_mkfolder(zTo, 0, 0);
392392
out = fossil_fopen(zTo, "wb");
393393
if( out==0 ) fossil_fatal("cannot open \"%s\" for writing", zTo);
394394
while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){
395395
fwrite(zBuf, 1, got, out);
396396
}
@@ -530,13 +530,16 @@
530530
}
531531
532532
/*
533533
** Create the tree of directories in which zFilename belongs, if that sequence
534534
** of directories does not already exist.
535
+**
536
+** On success, return zero. On error, return errorReturn if positive, otherwise
537
+** print an error message and abort.
535538
*/
536
-void file_mkfolder(const char *zFilename, int forceFlag){
537
- int i, nName;
539
+int file_mkfolder(const char *zFilename, int forceFlag, int errorReturn){
540
+ int i, nName, rc = 0;
538541
char *zName;
539542
540543
nName = strlen(zFilename);
541544
zName = mprintf("%s", zFilename);
542545
nName = file_simplify_name(zName, nName, 0);
@@ -550,20 +553,24 @@
550553
** C: in this example.
551554
*/
552555
if( !(i==2 && zName[1]==':') ){
553556
#endif
554557
if( file_mkdir(zName, forceFlag) && file_isdir(zName)!=1 ){
555
- fossil_fatal_recursive("unable to create directory %s", zName);
556
- return;
558
+ if (errorReturn <= 0) {
559
+ fossil_fatal_recursive("unable to create directory %s", zName);
560
+ }
561
+ rc = errorReturn;
562
+ break;
557563
}
558564
#if defined(_WIN32) || defined(__CYGWIN__)
559565
}
560566
#endif
561567
zName[i] = '/';
562568
}
563569
}
564570
free(zName);
571
+ return rc;
565572
}
566573
567574
/*
568575
** Removes the directory named in the argument, if it exists. The directory
569576
** must be empty and cannot be the current directory or the root directory.
570577
--- src/file.c
+++ src/file.c
@@ -386,11 +386,11 @@
386 FILE *in, *out;
387 int got;
388 char zBuf[8192];
389 in = fossil_fopen(zFrom, "rb");
390 if( in==0 ) fossil_fatal("cannot open \"%s\" for reading", zFrom);
391 file_mkfolder(zTo, 0);
392 out = fossil_fopen(zTo, "wb");
393 if( out==0 ) fossil_fatal("cannot open \"%s\" for writing", zTo);
394 while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){
395 fwrite(zBuf, 1, got, out);
396 }
@@ -530,13 +530,16 @@
530 }
531
532 /*
533 ** Create the tree of directories in which zFilename belongs, if that sequence
534 ** of directories does not already exist.
 
 
 
535 */
536 void file_mkfolder(const char *zFilename, int forceFlag){
537 int i, nName;
538 char *zName;
539
540 nName = strlen(zFilename);
541 zName = mprintf("%s", zFilename);
542 nName = file_simplify_name(zName, nName, 0);
@@ -550,20 +553,24 @@
550 ** C: in this example.
551 */
552 if( !(i==2 && zName[1]==':') ){
553 #endif
554 if( file_mkdir(zName, forceFlag) && file_isdir(zName)!=1 ){
555 fossil_fatal_recursive("unable to create directory %s", zName);
556 return;
 
 
 
557 }
558 #if defined(_WIN32) || defined(__CYGWIN__)
559 }
560 #endif
561 zName[i] = '/';
562 }
563 }
564 free(zName);
 
565 }
566
567 /*
568 ** Removes the directory named in the argument, if it exists. The directory
569 ** must be empty and cannot be the current directory or the root directory.
570
--- src/file.c
+++ src/file.c
@@ -386,11 +386,11 @@
386 FILE *in, *out;
387 int got;
388 char zBuf[8192];
389 in = fossil_fopen(zFrom, "rb");
390 if( in==0 ) fossil_fatal("cannot open \"%s\" for reading", zFrom);
391 file_mkfolder(zTo, 0, 0);
392 out = fossil_fopen(zTo, "wb");
393 if( out==0 ) fossil_fatal("cannot open \"%s\" for writing", zTo);
394 while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){
395 fwrite(zBuf, 1, got, out);
396 }
@@ -530,13 +530,16 @@
530 }
531
532 /*
533 ** Create the tree of directories in which zFilename belongs, if that sequence
534 ** of directories does not already exist.
535 **
536 ** On success, return zero. On error, return errorReturn if positive, otherwise
537 ** print an error message and abort.
538 */
539 int file_mkfolder(const char *zFilename, int forceFlag, int errorReturn){
540 int i, nName, rc = 0;
541 char *zName;
542
543 nName = strlen(zFilename);
544 zName = mprintf("%s", zFilename);
545 nName = file_simplify_name(zName, nName, 0);
@@ -550,20 +553,24 @@
553 ** C: in this example.
554 */
555 if( !(i==2 && zName[1]==':') ){
556 #endif
557 if( file_mkdir(zName, forceFlag) && file_isdir(zName)!=1 ){
558 if (errorReturn <= 0) {
559 fossil_fatal_recursive("unable to create directory %s", zName);
560 }
561 rc = errorReturn;
562 break;
563 }
564 #if defined(_WIN32) || defined(__CYGWIN__)
565 }
566 #endif
567 zName[i] = '/';
568 }
569 }
570 free(zName);
571 return rc;
572 }
573
574 /*
575 ** Removes the directory named in the argument, if it exists. The directory
576 ** must be empty and cannot be the current directory or the root directory.
577
+11 -10
--- src/login.c
+++ src/login.c
@@ -134,16 +134,16 @@
134134
return mprintf("%.*s", i, zIP);
135135
}
136136
137137
/*
138138
** Return an abbreviated project code. The abbreviation is the first
139
-** 16 characters of the project code.
139
+** 16 characters of the project code, or "x" if there is no project-code.
140140
**
141141
** Memory is obtained from malloc.
142142
*/
143143
static char *abbreviated_project_code(const char *zFullCode){
144
- return mprintf("%.16s", zFullCode);
144
+ return mprintf("%.16s", zFullCode ? zFullCode : "x");
145145
}
146146
147147
148148
/*
149149
** Check to see if the anonymous login is valid. If it is valid, return
@@ -232,15 +232,17 @@
232232
** subsequently stored in user.cookie for later validation.
233233
**
234234
** The returned memory should be free()d after use.
235235
*/
236236
char *login_gen_user_cookie_value(const char *zUsername, const char *zHash){
237
- char *zProjCode = db_get("project-code",NULL);
238
- char *zCode = abbreviated_project_code(zProjCode);
239
- free(zProjCode);
237
+ char *zCode = abbreviated_project_code(db_get("project-code", 0));
238
+ char *zCookie;
239
+
240240
assert((zUsername && *zUsername) && "Invalid user data.");
241
- return mprintf("%s/%z/%s", zHash, zCode, zUsername);
241
+ zCookie = mprintf("%s/%z/%s", zHash, zCode, zUsername);
242
+ free(zCode);
243
+ return zCookie;
242244
}
243245
244246
/*
245247
** Generates a login cookie for NON-ANONYMOUS users. Note that this
246248
** function "could" figure out the uid by itself but it currently
@@ -1455,11 +1457,11 @@
14551457
Stmt q; /* Query of all peer-* entries in CONFIG */
14561458
14571459
if( zPrefix==0 ) zPrefix = "";
14581460
if( zSuffix==0 ) zSuffix = "";
14591461
if( pzErrorMsg ) *pzErrorMsg = 0;
1460
- zSelfCode = abbreviated_project_code(db_get("project-code", "x"));
1462
+ zSelfCode = abbreviated_project_code(db_get("project-code", 0));
14611463
blob_zero(&err);
14621464
db_prepare(&q,
14631465
"SELECT name, value FROM config"
14641466
" WHERE name GLOB 'peer-repo-*'"
14651467
" AND name <> 'peer-repo-%q'"
@@ -1549,11 +1551,11 @@
15491551
/* Get the full pathname for our repository. Also the project code
15501552
** and project name for ourself. */
15511553
file_canonical_name(g.zRepositoryName, &fullName, 0);
15521554
zSelfRepo = fossil_strdup(blob_str(&fullName));
15531555
blob_reset(&fullName);
1554
- zSelfProjCode = db_get("project-code", "unknown");
1556
+ zSelfProjCode = abbreviated_project_code(db_get("project-code", 0));
15551557
zSelfLabel = db_get("project-name", 0);
15561558
if( zSelfLabel==0 ){
15571559
zSelfLabel = zSelfProjCode;
15581560
}
15591561
@@ -1601,11 +1603,10 @@
16011603
}
16021604
16031605
/* Create all the necessary CONFIG table entries on both the
16041606
** other repository and on our own repository.
16051607
*/
1606
- zSelfProjCode = abbreviated_project_code(zSelfProjCode);
16071608
zOtherProjCode = abbreviated_project_code(zOtherProjCode);
16081609
db_begin_transaction();
16091610
db_multi_exec(
16101611
"DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';"
16111612
"INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);"
@@ -1650,11 +1651,11 @@
16501651
void login_group_leave(char **pzErrMsg){
16511652
char *zProjCode;
16521653
char *zSql;
16531654
16541655
*pzErrMsg = 0;
1655
- zProjCode = abbreviated_project_code(db_get("project-code","x"));
1656
+ zProjCode = abbreviated_project_code(db_get("project-code", 0));
16561657
zSql = mprintf(
16571658
"DELETE FROM config WHERE name GLOB 'peer-*-%q';"
16581659
"DELETE FROM config"
16591660
" WHERE name='login-group-name'"
16601661
" AND (SELECT count(*) FROM config WHERE name GLOB 'peer-*')==0;",
16611662
--- src/login.c
+++ src/login.c
@@ -134,16 +134,16 @@
134 return mprintf("%.*s", i, zIP);
135 }
136
137 /*
138 ** Return an abbreviated project code. The abbreviation is the first
139 ** 16 characters of the project code.
140 **
141 ** Memory is obtained from malloc.
142 */
143 static char *abbreviated_project_code(const char *zFullCode){
144 return mprintf("%.16s", zFullCode);
145 }
146
147
148 /*
149 ** Check to see if the anonymous login is valid. If it is valid, return
@@ -232,15 +232,17 @@
232 ** subsequently stored in user.cookie for later validation.
233 **
234 ** The returned memory should be free()d after use.
235 */
236 char *login_gen_user_cookie_value(const char *zUsername, const char *zHash){
237 char *zProjCode = db_get("project-code",NULL);
238 char *zCode = abbreviated_project_code(zProjCode);
239 free(zProjCode);
240 assert((zUsername && *zUsername) && "Invalid user data.");
241 return mprintf("%s/%z/%s", zHash, zCode, zUsername);
 
 
242 }
243
244 /*
245 ** Generates a login cookie for NON-ANONYMOUS users. Note that this
246 ** function "could" figure out the uid by itself but it currently
@@ -1455,11 +1457,11 @@
1455 Stmt q; /* Query of all peer-* entries in CONFIG */
1456
1457 if( zPrefix==0 ) zPrefix = "";
1458 if( zSuffix==0 ) zSuffix = "";
1459 if( pzErrorMsg ) *pzErrorMsg = 0;
1460 zSelfCode = abbreviated_project_code(db_get("project-code", "x"));
1461 blob_zero(&err);
1462 db_prepare(&q,
1463 "SELECT name, value FROM config"
1464 " WHERE name GLOB 'peer-repo-*'"
1465 " AND name <> 'peer-repo-%q'"
@@ -1549,11 +1551,11 @@
1549 /* Get the full pathname for our repository. Also the project code
1550 ** and project name for ourself. */
1551 file_canonical_name(g.zRepositoryName, &fullName, 0);
1552 zSelfRepo = fossil_strdup(blob_str(&fullName));
1553 blob_reset(&fullName);
1554 zSelfProjCode = db_get("project-code", "unknown");
1555 zSelfLabel = db_get("project-name", 0);
1556 if( zSelfLabel==0 ){
1557 zSelfLabel = zSelfProjCode;
1558 }
1559
@@ -1601,11 +1603,10 @@
1601 }
1602
1603 /* Create all the necessary CONFIG table entries on both the
1604 ** other repository and on our own repository.
1605 */
1606 zSelfProjCode = abbreviated_project_code(zSelfProjCode);
1607 zOtherProjCode = abbreviated_project_code(zOtherProjCode);
1608 db_begin_transaction();
1609 db_multi_exec(
1610 "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';"
1611 "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);"
@@ -1650,11 +1651,11 @@
1650 void login_group_leave(char **pzErrMsg){
1651 char *zProjCode;
1652 char *zSql;
1653
1654 *pzErrMsg = 0;
1655 zProjCode = abbreviated_project_code(db_get("project-code","x"));
1656 zSql = mprintf(
1657 "DELETE FROM config WHERE name GLOB 'peer-*-%q';"
1658 "DELETE FROM config"
1659 " WHERE name='login-group-name'"
1660 " AND (SELECT count(*) FROM config WHERE name GLOB 'peer-*')==0;",
1661
--- src/login.c
+++ src/login.c
@@ -134,16 +134,16 @@
134 return mprintf("%.*s", i, zIP);
135 }
136
137 /*
138 ** Return an abbreviated project code. The abbreviation is the first
139 ** 16 characters of the project code, or "x" if there is no project-code.
140 **
141 ** Memory is obtained from malloc.
142 */
143 static char *abbreviated_project_code(const char *zFullCode){
144 return mprintf("%.16s", zFullCode ? zFullCode : "x");
145 }
146
147
148 /*
149 ** Check to see if the anonymous login is valid. If it is valid, return
@@ -232,15 +232,17 @@
232 ** subsequently stored in user.cookie for later validation.
233 **
234 ** The returned memory should be free()d after use.
235 */
236 char *login_gen_user_cookie_value(const char *zUsername, const char *zHash){
237 char *zCode = abbreviated_project_code(db_get("project-code", 0));
238 char *zCookie;
239
240 assert((zUsername && *zUsername) && "Invalid user data.");
241 zCookie = mprintf("%s/%z/%s", zHash, zCode, zUsername);
242 free(zCode);
243 return zCookie;
244 }
245
246 /*
247 ** Generates a login cookie for NON-ANONYMOUS users. Note that this
248 ** function "could" figure out the uid by itself but it currently
@@ -1455,11 +1457,11 @@
1457 Stmt q; /* Query of all peer-* entries in CONFIG */
1458
1459 if( zPrefix==0 ) zPrefix = "";
1460 if( zSuffix==0 ) zSuffix = "";
1461 if( pzErrorMsg ) *pzErrorMsg = 0;
1462 zSelfCode = abbreviated_project_code(db_get("project-code", 0));
1463 blob_zero(&err);
1464 db_prepare(&q,
1465 "SELECT name, value FROM config"
1466 " WHERE name GLOB 'peer-repo-*'"
1467 " AND name <> 'peer-repo-%q'"
@@ -1549,11 +1551,11 @@
1551 /* Get the full pathname for our repository. Also the project code
1552 ** and project name for ourself. */
1553 file_canonical_name(g.zRepositoryName, &fullName, 0);
1554 zSelfRepo = fossil_strdup(blob_str(&fullName));
1555 blob_reset(&fullName);
1556 zSelfProjCode = abbreviated_project_code(db_get("project-code", 0));
1557 zSelfLabel = db_get("project-name", 0);
1558 if( zSelfLabel==0 ){
1559 zSelfLabel = zSelfProjCode;
1560 }
1561
@@ -1601,11 +1603,10 @@
1603 }
1604
1605 /* Create all the necessary CONFIG table entries on both the
1606 ** other repository and on our own repository.
1607 */
 
1608 zOtherProjCode = abbreviated_project_code(zOtherProjCode);
1609 db_begin_transaction();
1610 db_multi_exec(
1611 "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';"
1612 "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);"
@@ -1650,11 +1651,11 @@
1651 void login_group_leave(char **pzErrMsg){
1652 char *zProjCode;
1653 char *zSql;
1654
1655 *pzErrMsg = 0;
1656 zProjCode = abbreviated_project_code(db_get("project-code", 0));
1657 zSql = mprintf(
1658 "DELETE FROM config WHERE name GLOB 'peer-*-%q';"
1659 "DELETE FROM config"
1660 " WHERE name='login-group-name'"
1661 " AND (SELECT count(*) FROM config WHERE name GLOB 'peer-*')==0;",
1662
+5 -5
--- src/timeline.c
+++ src/timeline.c
@@ -786,11 +786,11 @@
786786
}else{
787787
@ mergeOffset = railPitch-minRailPitch-mLine.w;
788788
@ mergeOffset = Math.min(mergeOffset, elems.mergeoffset.w);
789789
@ mergeOffset = mergeOffset>0 ? mergeOffset + line.w/2 : 0;
790790
}
791
- @
791
+ @
792792
@ var canvasWidth = (nrail-1)*railPitch + node.w;
793793
@ canvasDiv.style.width = canvasWidth + "px";
794794
@ canvasDiv.style.position = "relative";
795795
@ }
796796
@ function drawBox(cls,color,x0,y0,x1,y1){
@@ -1277,24 +1277,24 @@
12771277
return;
12781278
}
12791279
url_initialize(&url, "timeline");
12801280
cgi_query_parameters_to_url(&url);
12811281
if( zTagName && g.perm.Read ){
1282
- tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
1282
+ tagid = db_int(-1,"SELECT tagid FROM tag WHERE tagname='sym-%q'",zTagName);
12831283
zThisTag = zTagName;
12841284
}else if( zBrName && g.perm.Read ){
1285
- tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
1285
+ tagid = db_int(-1,"SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
12861286
zThisTag = zBrName;
12871287
}else{
12881288
tagid = 0;
12891289
}
12901290
if( zMark && zMark[0]==0 ){
12911291
if( zAfter ) zMark = zAfter;
12921292
if( zBefore ) zMark = zBefore;
12931293
if( zCirca ) zMark = zCirca;
12941294
}
1295
- if( tagid>0
1295
+ if( tagid
12961296
&& db_int(0,"SELECT count(*) FROM tagxref WHERE tagid=%d",tagid)<=nEntry
12971297
){
12981298
nEntry = -1;
12991299
zCirca = 0;
13001300
}
@@ -1493,11 +1493,11 @@
14931493
}
14941494
else if( zYearWeek ){
14951495
blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ",
14961496
zYearWeek);
14971497
}
1498
- if( tagid>0 ){
1498
+ if( tagid ){
14991499
blob_append_sql(&sql,
15001500
" AND (EXISTS(SELECT 1 FROM tagxref"
15011501
" WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid);
15021502
15031503
if( zBrName ){
15041504
--- src/timeline.c
+++ src/timeline.c
@@ -786,11 +786,11 @@
786 }else{
787 @ mergeOffset = railPitch-minRailPitch-mLine.w;
788 @ mergeOffset = Math.min(mergeOffset, elems.mergeoffset.w);
789 @ mergeOffset = mergeOffset>0 ? mergeOffset + line.w/2 : 0;
790 }
791 @
792 @ var canvasWidth = (nrail-1)*railPitch + node.w;
793 @ canvasDiv.style.width = canvasWidth + "px";
794 @ canvasDiv.style.position = "relative";
795 @ }
796 @ function drawBox(cls,color,x0,y0,x1,y1){
@@ -1277,24 +1277,24 @@
1277 return;
1278 }
1279 url_initialize(&url, "timeline");
1280 cgi_query_parameters_to_url(&url);
1281 if( zTagName && g.perm.Read ){
1282 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
1283 zThisTag = zTagName;
1284 }else if( zBrName && g.perm.Read ){
1285 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
1286 zThisTag = zBrName;
1287 }else{
1288 tagid = 0;
1289 }
1290 if( zMark && zMark[0]==0 ){
1291 if( zAfter ) zMark = zAfter;
1292 if( zBefore ) zMark = zBefore;
1293 if( zCirca ) zMark = zCirca;
1294 }
1295 if( tagid>0
1296 && db_int(0,"SELECT count(*) FROM tagxref WHERE tagid=%d",tagid)<=nEntry
1297 ){
1298 nEntry = -1;
1299 zCirca = 0;
1300 }
@@ -1493,11 +1493,11 @@
1493 }
1494 else if( zYearWeek ){
1495 blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ",
1496 zYearWeek);
1497 }
1498 if( tagid>0 ){
1499 blob_append_sql(&sql,
1500 " AND (EXISTS(SELECT 1 FROM tagxref"
1501 " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid);
1502
1503 if( zBrName ){
1504
--- src/timeline.c
+++ src/timeline.c
@@ -786,11 +786,11 @@
786 }else{
787 @ mergeOffset = railPitch-minRailPitch-mLine.w;
788 @ mergeOffset = Math.min(mergeOffset, elems.mergeoffset.w);
789 @ mergeOffset = mergeOffset>0 ? mergeOffset + line.w/2 : 0;
790 }
791 @
792 @ var canvasWidth = (nrail-1)*railPitch + node.w;
793 @ canvasDiv.style.width = canvasWidth + "px";
794 @ canvasDiv.style.position = "relative";
795 @ }
796 @ function drawBox(cls,color,x0,y0,x1,y1){
@@ -1277,24 +1277,24 @@
1277 return;
1278 }
1279 url_initialize(&url, "timeline");
1280 cgi_query_parameters_to_url(&url);
1281 if( zTagName && g.perm.Read ){
1282 tagid = db_int(-1,"SELECT tagid FROM tag WHERE tagname='sym-%q'",zTagName);
1283 zThisTag = zTagName;
1284 }else if( zBrName && g.perm.Read ){
1285 tagid = db_int(-1,"SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
1286 zThisTag = zBrName;
1287 }else{
1288 tagid = 0;
1289 }
1290 if( zMark && zMark[0]==0 ){
1291 if( zAfter ) zMark = zAfter;
1292 if( zBefore ) zMark = zBefore;
1293 if( zCirca ) zMark = zCirca;
1294 }
1295 if( tagid
1296 && db_int(0,"SELECT count(*) FROM tagxref WHERE tagid=%d",tagid)<=nEntry
1297 ){
1298 nEntry = -1;
1299 zCirca = 0;
1300 }
@@ -1493,11 +1493,11 @@
1493 }
1494 else if( zYearWeek ){
1495 blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ",
1496 zYearWeek);
1497 }
1498 if( tagid ){
1499 blob_append_sql(&sql,
1500 " AND (EXISTS(SELECT 1 FROM tagxref"
1501 " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid);
1502
1503 if( zBrName ){
1504
+5 -5
--- src/translate.c
+++ src/translate.c
@@ -40,15 +40,15 @@
4040
** rather than text that is to be output via cgi_printf(). Render it
4141
** as such.
4242
**
4343
** Enhancement #2:
4444
**
45
-** Comments of the form: "/* @-comment: CC" cause CC to become a
46
-** comment character for the @-substitution. Typical values for CC are
47
-** "--" (for SQL text) or "#" (for Tcl script) or "//" (for C++ code).
48
-** Lines of subsequent @-blocks that begin with CC are omitted from the
49
-** output.
45
+** Comments of the form: "|* @-comment: CC" (where "|" is really "/")
46
+** cause CC to become a comment character for the @-substitution.
47
+** Typical values for CC are "--" (for SQL text) or "#" (for Tcl script)
48
+** or "//" (for C++ code). Lines of subsequent @-blocks that begin with
49
+** CC are omitted from the output.
5050
**
5151
*/
5252
#include <stdio.h>
5353
#include <ctype.h>
5454
#include <stdlib.h>
5555
--- src/translate.c
+++ src/translate.c
@@ -40,15 +40,15 @@
40 ** rather than text that is to be output via cgi_printf(). Render it
41 ** as such.
42 **
43 ** Enhancement #2:
44 **
45 ** Comments of the form: "/* @-comment: CC" cause CC to become a
46 ** comment character for the @-substitution. Typical values for CC are
47 ** "--" (for SQL text) or "#" (for Tcl script) or "//" (for C++ code).
48 ** Lines of subsequent @-blocks that begin with CC are omitted from the
49 ** output.
50 **
51 */
52 #include <stdio.h>
53 #include <ctype.h>
54 #include <stdlib.h>
55
--- src/translate.c
+++ src/translate.c
@@ -40,15 +40,15 @@
40 ** rather than text that is to be output via cgi_printf(). Render it
41 ** as such.
42 **
43 ** Enhancement #2:
44 **
45 ** Comments of the form: "|* @-comment: CC" (where "|" is really "/")
46 ** cause CC to become a comment character for the @-substitution.
47 ** Typical values for CC are "--" (for SQL text) or "#" (for Tcl script)
48 ** or "//" (for C++ code). Lines of subsequent @-blocks that begin with
49 ** CC are omitted from the output.
50 **
51 */
52 #include <stdio.h>
53 #include <ctype.h>
54 #include <stdlib.h>
55
+16 -24
--- src/update.c
+++ src/update.c
@@ -586,43 +586,32 @@
586586
db_end_transaction(0);
587587
}
588588
}
589589
590590
/*
591
-** Make sure empty directories are created
591
+** Create empty directories specified by the empty-dirs setting.
592592
*/
593593
void ensure_empty_dirs_created(void){
594
- /* Make empty directories? */
595594
char *zEmptyDirs = db_get("empty-dirs", 0);
596595
if( zEmptyDirs!=0 ){
597
- char *bc;
596
+ int i;
598597
Blob dirName;
599598
Blob dirsList;
600599
601
- blob_zero(&dirsList);
602
- blob_init(&dirsList, zEmptyDirs, strlen(zEmptyDirs));
603
- /* Replace commas by spaces */
604
- bc = blob_str(&dirsList);
605
- while( (*bc)!='\0' ){
606
- if( (*bc)==',' ) { *bc = ' '; }
607
- ++bc;
608
- }
609
- /* Make directories */
610
- blob_zero(&dirName);
600
+ zEmptyDirs = fossil_strdup(zEmptyDirs);
601
+ for(i=0; zEmptyDirs[i]; i++){
602
+ if( zEmptyDirs[i]==',' ) zEmptyDirs[i] = ' ';
603
+ }
604
+ blob_init(&dirsList, zEmptyDirs, -1);
611605
while( blob_token(&dirsList, &dirName) ){
612
- const char *zDir = blob_str(&dirName);
613
- /* Make full pathname of the directory */
614
- Blob path;
615
- const char *zPath;
616
-
617
- blob_zero(&path);
618
- blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir);
619
- zPath = blob_str(&path);
620
- /* Handle various cases of existence of the directory */
606
+ char *zDir = blob_str(&dirName);
607
+ char *zPath = mprintf("%s/%s", g.zLocalRoot, zDir);
621608
switch( file_wd_isdir(zPath) ){
622609
case 0: { /* doesn't exist */
623
- if( file_mkdir(zPath, 0)!=0 ) {
610
+ fossil_free(zPath);
611
+ zPath = mprintf("%s/%s/x", g.zLocalRoot, zDir);
612
+ if( file_mkfolder(zPath, 0, 1)!=0 ) {
624613
fossil_warning("couldn't create directory %s as "
625614
"required by empty-dirs setting", zDir);
626615
}
627616
break;
628617
}
@@ -633,12 +622,15 @@
633622
case 2: { /* exists, but isn't a directory */
634623
fossil_warning("file %s found, but a directory is required "
635624
"by empty-dirs setting", zDir);
636625
}
637626
}
638
- blob_reset(&path);
627
+ fossil_free(zPath);
628
+ blob_reset(&dirName);
639629
}
630
+ blob_reset(&dirsList);
631
+ fossil_free(zEmptyDirs);
640632
}
641633
}
642634
643635
644636
/*
645637
--- src/update.c
+++ src/update.c
@@ -586,43 +586,32 @@
586 db_end_transaction(0);
587 }
588 }
589
590 /*
591 ** Make sure empty directories are created
592 */
593 void ensure_empty_dirs_created(void){
594 /* Make empty directories? */
595 char *zEmptyDirs = db_get("empty-dirs", 0);
596 if( zEmptyDirs!=0 ){
597 char *bc;
598 Blob dirName;
599 Blob dirsList;
600
601 blob_zero(&dirsList);
602 blob_init(&dirsList, zEmptyDirs, strlen(zEmptyDirs));
603 /* Replace commas by spaces */
604 bc = blob_str(&dirsList);
605 while( (*bc)!='\0' ){
606 if( (*bc)==',' ) { *bc = ' '; }
607 ++bc;
608 }
609 /* Make directories */
610 blob_zero(&dirName);
611 while( blob_token(&dirsList, &dirName) ){
612 const char *zDir = blob_str(&dirName);
613 /* Make full pathname of the directory */
614 Blob path;
615 const char *zPath;
616
617 blob_zero(&path);
618 blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir);
619 zPath = blob_str(&path);
620 /* Handle various cases of existence of the directory */
621 switch( file_wd_isdir(zPath) ){
622 case 0: { /* doesn't exist */
623 if( file_mkdir(zPath, 0)!=0 ) {
 
 
624 fossil_warning("couldn't create directory %s as "
625 "required by empty-dirs setting", zDir);
626 }
627 break;
628 }
@@ -633,12 +622,15 @@
633 case 2: { /* exists, but isn't a directory */
634 fossil_warning("file %s found, but a directory is required "
635 "by empty-dirs setting", zDir);
636 }
637 }
638 blob_reset(&path);
 
639 }
 
 
640 }
641 }
642
643
644 /*
645
--- src/update.c
+++ src/update.c
@@ -586,43 +586,32 @@
586 db_end_transaction(0);
587 }
588 }
589
590 /*
591 ** Create empty directories specified by the empty-dirs setting.
592 */
593 void ensure_empty_dirs_created(void){
 
594 char *zEmptyDirs = db_get("empty-dirs", 0);
595 if( zEmptyDirs!=0 ){
596 int i;
597 Blob dirName;
598 Blob dirsList;
599
600 zEmptyDirs = fossil_strdup(zEmptyDirs);
601 for(i=0; zEmptyDirs[i]; i++){
602 if( zEmptyDirs[i]==',' ) zEmptyDirs[i] = ' ';
603 }
604 blob_init(&dirsList, zEmptyDirs, -1);
 
 
 
 
 
605 while( blob_token(&dirsList, &dirName) ){
606 char *zDir = blob_str(&dirName);
607 char *zPath = mprintf("%s/%s", g.zLocalRoot, zDir);
 
 
 
 
 
 
 
608 switch( file_wd_isdir(zPath) ){
609 case 0: { /* doesn't exist */
610 fossil_free(zPath);
611 zPath = mprintf("%s/%s/x", g.zLocalRoot, zDir);
612 if( file_mkfolder(zPath, 0, 1)!=0 ) {
613 fossil_warning("couldn't create directory %s as "
614 "required by empty-dirs setting", zDir);
615 }
616 break;
617 }
@@ -633,12 +622,15 @@
622 case 2: { /* exists, but isn't a directory */
623 fossil_warning("file %s found, but a directory is required "
624 "by empty-dirs setting", zDir);
625 }
626 }
627 fossil_free(zPath);
628 blob_reset(&dirName);
629 }
630 blob_reset(&dirsList);
631 fossil_free(zEmptyDirs);
632 }
633 }
634
635
636 /*
637
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1151,11 +1151,13 @@
11511151
return zTarget+5;
11521152
}
11531153
if( strcmp(zTarget, "Sandbox")==0 ) return zTarget;
11541154
if( wiki_name_is_wellformed((const unsigned char *)zTarget)
11551155
&& ((p->state & WIKI_NOBADLINKS)==0 ||
1156
- db_exists("SELECT 1 FROM tag WHERE tagname GLOB 'wiki-%q'", zTarget))
1156
+ db_exists("SELECT 1 FROM tag WHERE tagname GLOB 'wiki-%q'"
1157
+ " AND (SELECT value FROM tagxref WHERE tagid=tag.tagid"
1158
+ " ORDER BY mtime DESC LIMIT 1) > 0", zTarget))
11571159
){
11581160
return zTarget;
11591161
}
11601162
return 0;
11611163
}
11621164
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1151,11 +1151,13 @@
1151 return zTarget+5;
1152 }
1153 if( strcmp(zTarget, "Sandbox")==0 ) return zTarget;
1154 if( wiki_name_is_wellformed((const unsigned char *)zTarget)
1155 && ((p->state & WIKI_NOBADLINKS)==0 ||
1156 db_exists("SELECT 1 FROM tag WHERE tagname GLOB 'wiki-%q'", zTarget))
 
 
1157 ){
1158 return zTarget;
1159 }
1160 return 0;
1161 }
1162
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1151,11 +1151,13 @@
1151 return zTarget+5;
1152 }
1153 if( strcmp(zTarget, "Sandbox")==0 ) return zTarget;
1154 if( wiki_name_is_wellformed((const unsigned char *)zTarget)
1155 && ((p->state & WIKI_NOBADLINKS)==0 ||
1156 db_exists("SELECT 1 FROM tag WHERE tagname GLOB 'wiki-%q'"
1157 " AND (SELECT value FROM tagxref WHERE tagid=tag.tagid"
1158 " ORDER BY mtime DESC LIMIT 1) > 0", zTarget))
1159 ){
1160 return zTarget;
1161 }
1162 return 0;
1163 }
1164
--- www/changes.wiki
+++ www/changes.wiki
@@ -43,10 +43,13 @@
4343
[/help?cmd=status|fossil status] report when executable or symlink status
4444
changes on otherwise unmodified files.
4545
* Permit filtering weekday and file [/help?cmd=/reports|reports] by user.
4646
Also ensure the user parameter is preserved when changing types. Add a
4747
field for direct entry of the user name to each applicable report.
48
+ * Create parent directories of [/help?cmd=settings|empty-dirs] if they don't
49
+ already exist.
50
+ * Inhibit timeline links to wiki pages that have been deleted.
4851
4952
<h2>Changes for Version 1.32 (2015-03-14)</h2>
5053
* When creating a new repository using [/help?cmd=init|fossil init], ensure
5154
that the new repository is fully compatible with historical versions of
5255
Fossil by having a valid manifest as RID 1.
5356
--- www/changes.wiki
+++ www/changes.wiki
@@ -43,10 +43,13 @@
43 [/help?cmd=status|fossil status] report when executable or symlink status
44 changes on otherwise unmodified files.
45 * Permit filtering weekday and file [/help?cmd=/reports|reports] by user.
46 Also ensure the user parameter is preserved when changing types. Add a
47 field for direct entry of the user name to each applicable report.
 
 
 
48
49 <h2>Changes for Version 1.32 (2015-03-14)</h2>
50 * When creating a new repository using [/help?cmd=init|fossil init], ensure
51 that the new repository is fully compatible with historical versions of
52 Fossil by having a valid manifest as RID 1.
53
--- www/changes.wiki
+++ www/changes.wiki
@@ -43,10 +43,13 @@
43 [/help?cmd=status|fossil status] report when executable or symlink status
44 changes on otherwise unmodified files.
45 * Permit filtering weekday and file [/help?cmd=/reports|reports] by user.
46 Also ensure the user parameter is preserved when changing types. Add a
47 field for direct entry of the user name to each applicable report.
48 * Create parent directories of [/help?cmd=settings|empty-dirs] if they don't
49 already exist.
50 * Inhibit timeline links to wiki pages that have been deleted.
51
52 <h2>Changes for Version 1.32 (2015-03-14)</h2>
53 * When creating a new repository using [/help?cmd=init|fossil init], ensure
54 that the new repository is fully compatible with historical versions of
55 Fossil by having a valid manifest as RID 1.
56
--- www/changes.wiki
+++ www/changes.wiki
@@ -43,10 +43,13 @@
4343
[/help?cmd=status|fossil status] report when executable or symlink status
4444
changes on otherwise unmodified files.
4545
* Permit filtering weekday and file [/help?cmd=/reports|reports] by user.
4646
Also ensure the user parameter is preserved when changing types. Add a
4747
field for direct entry of the user name to each applicable report.
48
+ * Create parent directories of [/help?cmd=settings|empty-dirs] if they don't
49
+ already exist.
50
+ * Inhibit timeline links to wiki pages that have been deleted.
4851
4952
<h2>Changes for Version 1.32 (2015-03-14)</h2>
5053
* When creating a new repository using [/help?cmd=init|fossil init], ensure
5154
that the new repository is fully compatible with historical versions of
5255
Fossil by having a valid manifest as RID 1.
5356
--- www/changes.wiki
+++ www/changes.wiki
@@ -43,10 +43,13 @@
43 [/help?cmd=status|fossil status] report when executable or symlink status
44 changes on otherwise unmodified files.
45 * Permit filtering weekday and file [/help?cmd=/reports|reports] by user.
46 Also ensure the user parameter is preserved when changing types. Add a
47 field for direct entry of the user name to each applicable report.
 
 
 
48
49 <h2>Changes for Version 1.32 (2015-03-14)</h2>
50 * When creating a new repository using [/help?cmd=init|fossil init], ensure
51 that the new repository is fully compatible with historical versions of
52 Fossil by having a valid manifest as RID 1.
53
--- www/changes.wiki
+++ www/changes.wiki
@@ -43,10 +43,13 @@
43 [/help?cmd=status|fossil status] report when executable or symlink status
44 changes on otherwise unmodified files.
45 * Permit filtering weekday and file [/help?cmd=/reports|reports] by user.
46 Also ensure the user parameter is preserved when changing types. Add a
47 field for direct entry of the user name to each applicable report.
48 * Create parent directories of [/help?cmd=settings|empty-dirs] if they don't
49 already exist.
50 * Inhibit timeline links to wiki pages that have been deleted.
51
52 <h2>Changes for Version 1.32 (2015-03-14)</h2>
53 * When creating a new repository using [/help?cmd=init|fossil init], ensure
54 that the new repository is fully compatible with historical versions of
55 Fossil by having a valid manifest as RID 1.
56

Keyboard Shortcuts

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