Fossil SCM

merge trunk

jan.nijtmans 2012-11-04 10:50 improve_commit_warning merge
Commit bd7b8a485f969da0126db57f82305c679f412109
+1 -1
--- src/blob.c
+++ src/blob.c
@@ -1121,12 +1121,12 @@
11211121
blob_zero(pBlob);
11221122
blob_append(pBlob, zUtf8, -1);
11231123
fossil_mbcs_free(zUtf8);
11241124
}else if( blob_size(pBlob)>1 && (blob_size(pBlob)&1)==0
11251125
&& memcmp(blob_buffer(pBlob), &urbom, 2)==0 ) {
1126
- zUtf8 = blob_buffer(pBlob);
11271126
unsigned int i = blob_size(pBlob);
1127
+ zUtf8 = blob_buffer(pBlob);
11281128
while( i > 0 ){
11291129
/* swap bytes of unicode representation */
11301130
char temp = zUtf8[--i];
11311131
zUtf8[i] = zUtf8[i-1];
11321132
zUtf8[--i] = temp;
11331133
--- src/blob.c
+++ src/blob.c
@@ -1121,12 +1121,12 @@
1121 blob_zero(pBlob);
1122 blob_append(pBlob, zUtf8, -1);
1123 fossil_mbcs_free(zUtf8);
1124 }else if( blob_size(pBlob)>1 && (blob_size(pBlob)&1)==0
1125 && memcmp(blob_buffer(pBlob), &urbom, 2)==0 ) {
1126 zUtf8 = blob_buffer(pBlob);
1127 unsigned int i = blob_size(pBlob);
 
1128 while( i > 0 ){
1129 /* swap bytes of unicode representation */
1130 char temp = zUtf8[--i];
1131 zUtf8[i] = zUtf8[i-1];
1132 zUtf8[--i] = temp;
1133
--- src/blob.c
+++ src/blob.c
@@ -1121,12 +1121,12 @@
1121 blob_zero(pBlob);
1122 blob_append(pBlob, zUtf8, -1);
1123 fossil_mbcs_free(zUtf8);
1124 }else if( blob_size(pBlob)>1 && (blob_size(pBlob)&1)==0
1125 && memcmp(blob_buffer(pBlob), &urbom, 2)==0 ) {
 
1126 unsigned int i = blob_size(pBlob);
1127 zUtf8 = blob_buffer(pBlob);
1128 while( i > 0 ){
1129 /* swap bytes of unicode representation */
1130 char temp = zUtf8[--i];
1131 zUtf8[i] = zUtf8[i-1];
1132 zUtf8[--i] = temp;
1133
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -913,11 +913,11 @@
913913
char cReply;
914914
915915
blob_zero(&ans);
916916
file_relative_name(zFilename, &fname, 0);
917917
zMsg = mprintf(
918
- "%s appears to be text, but not UTF-8 or ASCII. commit anyhow (a=all/y/N)? ",
918
+ "%s appears to be text, but not UTF-8 or ASCII. commit anyhow (y/N)? ",
919919
blob_str(&fname));
920920
prompt_user(zMsg, &ans);
921921
fossil_free(zMsg);
922922
cReply = blob_str(&ans)[0];
923923
if( cReply!='y' && cReply!='Y' ){
924924
--- src/checkin.c
+++ src/checkin.c
@@ -913,11 +913,11 @@
913 char cReply;
914
915 blob_zero(&ans);
916 file_relative_name(zFilename, &fname, 0);
917 zMsg = mprintf(
918 "%s appears to be text, but not UTF-8 or ASCII. commit anyhow (a=all/y/N)? ",
919 blob_str(&fname));
920 prompt_user(zMsg, &ans);
921 fossil_free(zMsg);
922 cReply = blob_str(&ans)[0];
923 if( cReply!='y' && cReply!='Y' ){
924
--- src/checkin.c
+++ src/checkin.c
@@ -913,11 +913,11 @@
913 char cReply;
914
915 blob_zero(&ans);
916 file_relative_name(zFilename, &fname, 0);
917 zMsg = mprintf(
918 "%s appears to be text, but not UTF-8 or ASCII. commit anyhow (y/N)? ",
919 blob_str(&fname));
920 prompt_user(zMsg, &ans);
921 fossil_free(zMsg);
922 cReply = blob_str(&ans)[0];
923 if( cReply!='y' && cReply!='Y' ){
924
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -913,11 +913,11 @@
913913
char cReply;
914914
915915
blob_zero(&ans);
916916
file_relative_name(zFilename, &fname, 0);
917917
zMsg = mprintf(
918
- "%s appears to be text, but not UTF-8 or ASCII. commit anyhow (a=all/y/N)? ",
918
+ "%s appears to be text, but not UTF-8 or ASCII. commit anyhow (y/N)? ",
919919
blob_str(&fname));
920920
prompt_user(zMsg, &ans);
921921
fossil_free(zMsg);
922922
cReply = blob_str(&ans)[0];
923923
if( cReply!='y' && cReply!='Y' ){
924924
--- src/checkin.c
+++ src/checkin.c
@@ -913,11 +913,11 @@
913 char cReply;
914
915 blob_zero(&ans);
916 file_relative_name(zFilename, &fname, 0);
917 zMsg = mprintf(
918 "%s appears to be text, but not UTF-8 or ASCII. commit anyhow (a=all/y/N)? ",
919 blob_str(&fname));
920 prompt_user(zMsg, &ans);
921 fossil_free(zMsg);
922 cReply = blob_str(&ans)[0];
923 if( cReply!='y' && cReply!='Y' ){
924
--- src/checkin.c
+++ src/checkin.c
@@ -913,11 +913,11 @@
913 char cReply;
914
915 blob_zero(&ans);
916 file_relative_name(zFilename, &fname, 0);
917 zMsg = mprintf(
918 "%s appears to be text, but not UTF-8 or ASCII. commit anyhow (y/N)? ",
919 blob_str(&fname));
920 prompt_user(zMsg, &ans);
921 fossil_free(zMsg);
922 cReply = blob_str(&ans)[0];
923 if( cReply!='y' && cReply!='Y' ){
924
+8 -8
--- src/db.c
+++ src/db.c
@@ -2027,20 +2027,20 @@
20272027
{ "allow-symlinks",0, 0, 1, "off" },
20282028
{ "auto-captcha", "autocaptcha", 0, 0, "on" },
20292029
{ "auto-hyperlink",0, 0, 0, "on", },
20302030
{ "auto-shun", 0, 0, 0, "on" },
20312031
{ "autosync", 0, 0, 0, "on" },
2032
- { "binary-glob", 0, 32, 1, "" },
2032
+ { "binary-glob", 0, 40, 1, "" },
20332033
{ "clearsign", 0, 0, 0, "off" },
20342034
{ "case-sensitive",0, 0, 0, "on" },
2035
- { "crnl-glob", 0, 16, 1, "" },
2035
+ { "crnl-glob", 0, 40, 1, "" },
20362036
{ "default-perms", 0, 16, 0, "u" },
20372037
{ "diff-binary", 0, 0, 0, "on" },
2038
- { "diff-command", 0, 16, 0, "" },
2038
+ { "diff-command", 0, 40, 0, "" },
20392039
{ "dont-push", 0, 0, 0, "off" },
2040
- { "editor", 0, 16, 0, "" },
2041
- { "gdiff-command", 0, 16, 0, "gdiff" },
2040
+ { "editor", 0, 32, 0, "" },
2041
+ { "gdiff-command", 0, 40, 0, "gdiff" },
20422042
{ "gmerge-command",0, 40, 0, "" },
20432043
{ "https-login", 0, 0, 0, "off" },
20442044
{ "ignore-glob", 0, 40, 1, "" },
20452045
{ "empty-dirs", 0, 40, 1, "" },
20462046
{ "http-port", 0, 16, 0, "8080" },
@@ -2047,18 +2047,18 @@
20472047
{ "localauth", 0, 0, 0, "off" },
20482048
{ "main-branch", 0, 40, 0, "trunk" },
20492049
{ "manifest", 0, 0, 1, "off" },
20502050
{ "max-upload", 0, 25, 0, "250000" },
20512051
{ "mtime-changes", 0, 0, 0, "on" },
2052
- { "pgp-command", 0, 32, 0, "gpg --clearsign -o " },
2052
+ { "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
20532053
{ "proxy", 0, 32, 0, "off" },
20542054
{ "relative-paths",0, 0, 0, "on" },
20552055
{ "repo-cksum", 0, 0, 0, "on" },
20562056
{ "self-register", 0, 0, 0, "off" },
20572057
{ "ssl-ca-location",0, 40, 0, "" },
20582058
{ "ssl-identity", 0, 40, 0, "" },
2059
- { "ssh-command", 0, 32, 0, "" },
2059
+ { "ssh-command", 0, 40, 0, "" },
20602060
#ifdef FOSSIL_ENABLE_TCL
20612061
{ "tcl", 0, 0, 0, "off" },
20622062
{ "tcl-setup", 0, 40, 0, "" },
20632063
#endif
20642064
{ "web-browser", 0, 32, 0, "" },
@@ -2108,11 +2108,11 @@
21082108
** then only pull operations occur automatically.
21092109
** Default: on
21102110
**
21112111
** binary-glob The VALUE is a comma or newline-separated list of
21122112
** (versionable) GLOB patterns that should be treated as binary files
2113
-** for merging purposes. Example: *.xml
2113
+** for committing and merging purposes. Example: *.jpg
21142114
**
21152115
** case-sensitive If TRUE, the files whose names differ only in case
21162116
** care considered distinct. If FALSE files whose names
21172117
** differ only in case are the same file. Defaults to
21182118
** TRUE for unix and FALSE for windows and mac.
21192119
--- src/db.c
+++ src/db.c
@@ -2027,20 +2027,20 @@
2027 { "allow-symlinks",0, 0, 1, "off" },
2028 { "auto-captcha", "autocaptcha", 0, 0, "on" },
2029 { "auto-hyperlink",0, 0, 0, "on", },
2030 { "auto-shun", 0, 0, 0, "on" },
2031 { "autosync", 0, 0, 0, "on" },
2032 { "binary-glob", 0, 32, 1, "" },
2033 { "clearsign", 0, 0, 0, "off" },
2034 { "case-sensitive",0, 0, 0, "on" },
2035 { "crnl-glob", 0, 16, 1, "" },
2036 { "default-perms", 0, 16, 0, "u" },
2037 { "diff-binary", 0, 0, 0, "on" },
2038 { "diff-command", 0, 16, 0, "" },
2039 { "dont-push", 0, 0, 0, "off" },
2040 { "editor", 0, 16, 0, "" },
2041 { "gdiff-command", 0, 16, 0, "gdiff" },
2042 { "gmerge-command",0, 40, 0, "" },
2043 { "https-login", 0, 0, 0, "off" },
2044 { "ignore-glob", 0, 40, 1, "" },
2045 { "empty-dirs", 0, 40, 1, "" },
2046 { "http-port", 0, 16, 0, "8080" },
@@ -2047,18 +2047,18 @@
2047 { "localauth", 0, 0, 0, "off" },
2048 { "main-branch", 0, 40, 0, "trunk" },
2049 { "manifest", 0, 0, 1, "off" },
2050 { "max-upload", 0, 25, 0, "250000" },
2051 { "mtime-changes", 0, 0, 0, "on" },
2052 { "pgp-command", 0, 32, 0, "gpg --clearsign -o " },
2053 { "proxy", 0, 32, 0, "off" },
2054 { "relative-paths",0, 0, 0, "on" },
2055 { "repo-cksum", 0, 0, 0, "on" },
2056 { "self-register", 0, 0, 0, "off" },
2057 { "ssl-ca-location",0, 40, 0, "" },
2058 { "ssl-identity", 0, 40, 0, "" },
2059 { "ssh-command", 0, 32, 0, "" },
2060 #ifdef FOSSIL_ENABLE_TCL
2061 { "tcl", 0, 0, 0, "off" },
2062 { "tcl-setup", 0, 40, 0, "" },
2063 #endif
2064 { "web-browser", 0, 32, 0, "" },
@@ -2108,11 +2108,11 @@
2108 ** then only pull operations occur automatically.
2109 ** Default: on
2110 **
2111 ** binary-glob The VALUE is a comma or newline-separated list of
2112 ** (versionable) GLOB patterns that should be treated as binary files
2113 ** for merging purposes. Example: *.xml
2114 **
2115 ** case-sensitive If TRUE, the files whose names differ only in case
2116 ** care considered distinct. If FALSE files whose names
2117 ** differ only in case are the same file. Defaults to
2118 ** TRUE for unix and FALSE for windows and mac.
2119
--- src/db.c
+++ src/db.c
@@ -2027,20 +2027,20 @@
2027 { "allow-symlinks",0, 0, 1, "off" },
2028 { "auto-captcha", "autocaptcha", 0, 0, "on" },
2029 { "auto-hyperlink",0, 0, 0, "on", },
2030 { "auto-shun", 0, 0, 0, "on" },
2031 { "autosync", 0, 0, 0, "on" },
2032 { "binary-glob", 0, 40, 1, "" },
2033 { "clearsign", 0, 0, 0, "off" },
2034 { "case-sensitive",0, 0, 0, "on" },
2035 { "crnl-glob", 0, 40, 1, "" },
2036 { "default-perms", 0, 16, 0, "u" },
2037 { "diff-binary", 0, 0, 0, "on" },
2038 { "diff-command", 0, 40, 0, "" },
2039 { "dont-push", 0, 0, 0, "off" },
2040 { "editor", 0, 32, 0, "" },
2041 { "gdiff-command", 0, 40, 0, "gdiff" },
2042 { "gmerge-command",0, 40, 0, "" },
2043 { "https-login", 0, 0, 0, "off" },
2044 { "ignore-glob", 0, 40, 1, "" },
2045 { "empty-dirs", 0, 40, 1, "" },
2046 { "http-port", 0, 16, 0, "8080" },
@@ -2047,18 +2047,18 @@
2047 { "localauth", 0, 0, 0, "off" },
2048 { "main-branch", 0, 40, 0, "trunk" },
2049 { "manifest", 0, 0, 1, "off" },
2050 { "max-upload", 0, 25, 0, "250000" },
2051 { "mtime-changes", 0, 0, 0, "on" },
2052 { "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
2053 { "proxy", 0, 32, 0, "off" },
2054 { "relative-paths",0, 0, 0, "on" },
2055 { "repo-cksum", 0, 0, 0, "on" },
2056 { "self-register", 0, 0, 0, "off" },
2057 { "ssl-ca-location",0, 40, 0, "" },
2058 { "ssl-identity", 0, 40, 0, "" },
2059 { "ssh-command", 0, 40, 0, "" },
2060 #ifdef FOSSIL_ENABLE_TCL
2061 { "tcl", 0, 0, 0, "off" },
2062 { "tcl-setup", 0, 40, 0, "" },
2063 #endif
2064 { "web-browser", 0, 32, 0, "" },
@@ -2108,11 +2108,11 @@
2108 ** then only pull operations occur automatically.
2109 ** Default: on
2110 **
2111 ** binary-glob The VALUE is a comma or newline-separated list of
2112 ** (versionable) GLOB patterns that should be treated as binary files
2113 ** for committing and merging purposes. Example: *.jpg
2114 **
2115 ** case-sensitive If TRUE, the files whose names differ only in case
2116 ** care considered distinct. If FALSE files whose names
2117 ** differ only in case are the same file. Defaults to
2118 ** TRUE for unix and FALSE for windows and mac.
2119
+43 -11
--- src/diff.c
+++ src/diff.c
@@ -193,10 +193,21 @@
193193
**
194194
** (-5) -- The content appears to consist entirely of text, with lines
195195
** delimited by carriage-return, line-feed pairs; however, the
196196
** encoding is not UTF-8 or ASCII.
197197
**
198
+************************************ WARNING **********************************
199
+**
200
+** This function does not validate that the blob content is properly formed
201
+** UTF-8. It assumes that all code points are the same size. It does not
202
+** validate any code points. It makes no attempt to detect if any [invalid]
203
+** switches between UTF-8 and other encodings occur.
204
+**
205
+** The only code points that this function cares about are the NUL character,
206
+** carriage-return, and line-feed.
207
+**
208
+************************************ WARNING **********************************
198209
*/
199210
200211
int looks_like_utf8(const Blob *pContent){
201212
unsigned char *z = (unsigned char *) blob_buffer(pContent);
202213
unsigned int n = blob_size(pContent);
@@ -273,26 +284,36 @@
273284
}
274285
return 1-result; /* No problems seen -> not binary */
275286
}
276287
277288
/*
278
-** Maximum length of a line in a text file, in UTF-16 characters. (2731)
279
-** The number of bytes represented by this value after conversion to
280
-** UTF-8 (which can increase the size by 50%) cannot exceed LENGTH_MASK
289
+** Define the type needed to represent a Unicode (UTF-16) character.
290
+*/
291
+#ifndef WCHAR_T
292
+# ifdef _WIN32
293
+# define WCHAR_T wchar_t
294
+# else
295
+# define WCHAR_T unsigned short
296
+# endif
297
+#endif
298
+
299
+/*
300
+** Maximum length of a line in a text file, in UTF-16 characters. (4096)
301
+** The number of bytes represented by this value cannot exceed LENGTH_MASK
281302
** bytes, because that is the line buffer size used by the diff engine.
282303
*/
283
-#define UTF16_LENGTH_MASK (LENGTH_MASK/3)
304
+#define UTF16_LENGTH_MASK_SZ (LENGTH_MASK_SZ-(sizeof(WCHAR_T)-sizeof(char)))
305
+#define UTF16_LENGTH_MASK ((1<<UTF16_LENGTH_MASK_SZ)-1)
284306
285307
/*
286308
** The carriage-return / line-feed characters in the UTF-16be and UTF-16le
287309
** encodings.
288310
*/
289
-#define UTF16BE_CR ((wchar_t)'\r')
290
-#define UTF16BE_LF ((wchar_t)'\n')
291
-#define UTF16LE_CR (((wchar_t)'\r')<<(sizeof(wchar_t)<<2))
292
-#define UTF16LE_LF (((wchar_t)'\n')<<(sizeof(wchar_t)<<2))
293
-#define UTF16_FFFF ((wchar_t)-1)
311
+#define UTF16BE_CR ((WCHAR_T)'\r')
312
+#define UTF16BE_LF ((WCHAR_T)'\n')
313
+#define UTF16LE_CR (((WCHAR_T)'\r')<<(sizeof(char)<<3))
314
+#define UTF16LE_LF (((WCHAR_T)'\n')<<(sizeof(char)<<3))
294315
295316
/*
296317
** This function attempts to scan each logical line within the blob to
297318
** determine the type of content it appears to contain. Possible return
298319
** values are:
@@ -308,13 +329,24 @@
308329
**
309330
** (-1) -- The content appears to consist entirely of text, with lines
310331
** delimited by carriage-return, line-feed pairs; however, the
311332
** encoding may not be UTF-16.
312333
**
334
+************************************ WARNING **********************************
335
+**
336
+** This function does not validate that the blob content is properly formed
337
+** UTF-16. It assumes that all code points are the same size. It does not
338
+** validate any code points. It makes no attempt to detect if any [invalid]
339
+** switches between the UTF-16be and UTF-16le encodings occur.
340
+**
341
+** The only code points that this function cares about are the NUL character,
342
+** carriage-return, and line-feed.
343
+**
344
+************************************ WARNING **********************************
313345
*/
314346
int looks_like_utf16(const Blob *pContent){
315
- const wchar_t *z = (wchar_t *)blob_buffer(pContent);
347
+ const WCHAR_T *z = (WCHAR_T *)blob_buffer(pContent);
316348
unsigned int n = blob_size(pContent);
317349
int j, c;
318350
int result = 1; /* Assume UTF-16 text with no CR/NL */
319351
320352
/* Check individual lines.
@@ -324,11 +356,11 @@
324356
c = *z;
325357
if( c==0 ) return 0; /* NUL character in a file -> binary */
326358
j = ((c!=UTF16BE_LF) && (c!=UTF16LE_LF));
327359
while( (n-=2)>0 ){
328360
c = *++z; ++j;
329
- if( c==0 || c==UTF16_FFFF ) return 0; /* NUL/FFFF character in a file -> binary */
361
+ if( c==0 ) return 0; /* NUL character in a file -> binary */
330362
if( c==UTF16BE_LF || c==UTF16LE_LF ){
331363
int c2 = z[-1];
332364
if( c2==UTF16BE_CR || c2==UTF16LE_CR ){
333365
result = -1; /* Contains CR/NL, continue */
334366
}
335367
--- src/diff.c
+++ src/diff.c
@@ -193,10 +193,21 @@
193 **
194 ** (-5) -- The content appears to consist entirely of text, with lines
195 ** delimited by carriage-return, line-feed pairs; however, the
196 ** encoding is not UTF-8 or ASCII.
197 **
 
 
 
 
 
 
 
 
 
 
 
198 */
199
200 int looks_like_utf8(const Blob *pContent){
201 unsigned char *z = (unsigned char *) blob_buffer(pContent);
202 unsigned int n = blob_size(pContent);
@@ -273,26 +284,36 @@
273 }
274 return 1-result; /* No problems seen -> not binary */
275 }
276
277 /*
278 ** Maximum length of a line in a text file, in UTF-16 characters. (2731)
279 ** The number of bytes represented by this value after conversion to
280 ** UTF-8 (which can increase the size by 50%) cannot exceed LENGTH_MASK
 
 
 
 
 
 
 
 
 
 
281 ** bytes, because that is the line buffer size used by the diff engine.
282 */
283 #define UTF16_LENGTH_MASK (LENGTH_MASK/3)
 
284
285 /*
286 ** The carriage-return / line-feed characters in the UTF-16be and UTF-16le
287 ** encodings.
288 */
289 #define UTF16BE_CR ((wchar_t)'\r')
290 #define UTF16BE_LF ((wchar_t)'\n')
291 #define UTF16LE_CR (((wchar_t)'\r')<<(sizeof(wchar_t)<<2))
292 #define UTF16LE_LF (((wchar_t)'\n')<<(sizeof(wchar_t)<<2))
293 #define UTF16_FFFF ((wchar_t)-1)
294
295 /*
296 ** This function attempts to scan each logical line within the blob to
297 ** determine the type of content it appears to contain. Possible return
298 ** values are:
@@ -308,13 +329,24 @@
308 **
309 ** (-1) -- The content appears to consist entirely of text, with lines
310 ** delimited by carriage-return, line-feed pairs; however, the
311 ** encoding may not be UTF-16.
312 **
 
 
 
 
 
 
 
 
 
 
 
313 */
314 int looks_like_utf16(const Blob *pContent){
315 const wchar_t *z = (wchar_t *)blob_buffer(pContent);
316 unsigned int n = blob_size(pContent);
317 int j, c;
318 int result = 1; /* Assume UTF-16 text with no CR/NL */
319
320 /* Check individual lines.
@@ -324,11 +356,11 @@
324 c = *z;
325 if( c==0 ) return 0; /* NUL character in a file -> binary */
326 j = ((c!=UTF16BE_LF) && (c!=UTF16LE_LF));
327 while( (n-=2)>0 ){
328 c = *++z; ++j;
329 if( c==0 || c==UTF16_FFFF ) return 0; /* NUL/FFFF character in a file -> binary */
330 if( c==UTF16BE_LF || c==UTF16LE_LF ){
331 int c2 = z[-1];
332 if( c2==UTF16BE_CR || c2==UTF16LE_CR ){
333 result = -1; /* Contains CR/NL, continue */
334 }
335
--- src/diff.c
+++ src/diff.c
@@ -193,10 +193,21 @@
193 **
194 ** (-5) -- The content appears to consist entirely of text, with lines
195 ** delimited by carriage-return, line-feed pairs; however, the
196 ** encoding is not UTF-8 or ASCII.
197 **
198 ************************************ WARNING **********************************
199 **
200 ** This function does not validate that the blob content is properly formed
201 ** UTF-8. It assumes that all code points are the same size. It does not
202 ** validate any code points. It makes no attempt to detect if any [invalid]
203 ** switches between UTF-8 and other encodings occur.
204 **
205 ** The only code points that this function cares about are the NUL character,
206 ** carriage-return, and line-feed.
207 **
208 ************************************ WARNING **********************************
209 */
210
211 int looks_like_utf8(const Blob *pContent){
212 unsigned char *z = (unsigned char *) blob_buffer(pContent);
213 unsigned int n = blob_size(pContent);
@@ -273,26 +284,36 @@
284 }
285 return 1-result; /* No problems seen -> not binary */
286 }
287
288 /*
289 ** Define the type needed to represent a Unicode (UTF-16) character.
290 */
291 #ifndef WCHAR_T
292 # ifdef _WIN32
293 # define WCHAR_T wchar_t
294 # else
295 # define WCHAR_T unsigned short
296 # endif
297 #endif
298
299 /*
300 ** Maximum length of a line in a text file, in UTF-16 characters. (4096)
301 ** The number of bytes represented by this value cannot exceed LENGTH_MASK
302 ** bytes, because that is the line buffer size used by the diff engine.
303 */
304 #define UTF16_LENGTH_MASK_SZ (LENGTH_MASK_SZ-(sizeof(WCHAR_T)-sizeof(char)))
305 #define UTF16_LENGTH_MASK ((1<<UTF16_LENGTH_MASK_SZ)-1)
306
307 /*
308 ** The carriage-return / line-feed characters in the UTF-16be and UTF-16le
309 ** encodings.
310 */
311 #define UTF16BE_CR ((WCHAR_T)'\r')
312 #define UTF16BE_LF ((WCHAR_T)'\n')
313 #define UTF16LE_CR (((WCHAR_T)'\r')<<(sizeof(char)<<3))
314 #define UTF16LE_LF (((WCHAR_T)'\n')<<(sizeof(char)<<3))
 
315
316 /*
317 ** This function attempts to scan each logical line within the blob to
318 ** determine the type of content it appears to contain. Possible return
319 ** values are:
@@ -308,13 +329,24 @@
329 **
330 ** (-1) -- The content appears to consist entirely of text, with lines
331 ** delimited by carriage-return, line-feed pairs; however, the
332 ** encoding may not be UTF-16.
333 **
334 ************************************ WARNING **********************************
335 **
336 ** This function does not validate that the blob content is properly formed
337 ** UTF-16. It assumes that all code points are the same size. It does not
338 ** validate any code points. It makes no attempt to detect if any [invalid]
339 ** switches between the UTF-16be and UTF-16le encodings occur.
340 **
341 ** The only code points that this function cares about are the NUL character,
342 ** carriage-return, and line-feed.
343 **
344 ************************************ WARNING **********************************
345 */
346 int looks_like_utf16(const Blob *pContent){
347 const WCHAR_T *z = (WCHAR_T *)blob_buffer(pContent);
348 unsigned int n = blob_size(pContent);
349 int j, c;
350 int result = 1; /* Assume UTF-16 text with no CR/NL */
351
352 /* Check individual lines.
@@ -324,11 +356,11 @@
356 c = *z;
357 if( c==0 ) return 0; /* NUL character in a file -> binary */
358 j = ((c!=UTF16BE_LF) && (c!=UTF16LE_LF));
359 while( (n-=2)>0 ){
360 c = *++z; ++j;
361 if( c==0 ) return 0; /* NUL character in a file -> binary */
362 if( c==UTF16BE_LF || c==UTF16LE_LF ){
363 int c2 = z[-1];
364 if( c2==UTF16BE_CR || c2==UTF16LE_CR ){
365 result = -1; /* Contains CR/NL, continue */
366 }
367
+43 -11
--- src/diff.c
+++ src/diff.c
@@ -193,10 +193,21 @@
193193
**
194194
** (-5) -- The content appears to consist entirely of text, with lines
195195
** delimited by carriage-return, line-feed pairs; however, the
196196
** encoding is not UTF-8 or ASCII.
197197
**
198
+************************************ WARNING **********************************
199
+**
200
+** This function does not validate that the blob content is properly formed
201
+** UTF-8. It assumes that all code points are the same size. It does not
202
+** validate any code points. It makes no attempt to detect if any [invalid]
203
+** switches between UTF-8 and other encodings occur.
204
+**
205
+** The only code points that this function cares about are the NUL character,
206
+** carriage-return, and line-feed.
207
+**
208
+************************************ WARNING **********************************
198209
*/
199210
200211
int looks_like_utf8(const Blob *pContent){
201212
unsigned char *z = (unsigned char *) blob_buffer(pContent);
202213
unsigned int n = blob_size(pContent);
@@ -273,26 +284,36 @@
273284
}
274285
return 1-result; /* No problems seen -> not binary */
275286
}
276287
277288
/*
278
-** Maximum length of a line in a text file, in UTF-16 characters. (2731)
279
-** The number of bytes represented by this value after conversion to
280
-** UTF-8 (which can increase the size by 50%) cannot exceed LENGTH_MASK
289
+** Define the type needed to represent a Unicode (UTF-16) character.
290
+*/
291
+#ifndef WCHAR_T
292
+# ifdef _WIN32
293
+# define WCHAR_T wchar_t
294
+# else
295
+# define WCHAR_T unsigned short
296
+# endif
297
+#endif
298
+
299
+/*
300
+** Maximum length of a line in a text file, in UTF-16 characters. (4096)
301
+** The number of bytes represented by this value cannot exceed LENGTH_MASK
281302
** bytes, because that is the line buffer size used by the diff engine.
282303
*/
283
-#define UTF16_LENGTH_MASK (LENGTH_MASK/3)
304
+#define UTF16_LENGTH_MASK_SZ (LENGTH_MASK_SZ-(sizeof(WCHAR_T)-sizeof(char)))
305
+#define UTF16_LENGTH_MASK ((1<<UTF16_LENGTH_MASK_SZ)-1)
284306
285307
/*
286308
** The carriage-return / line-feed characters in the UTF-16be and UTF-16le
287309
** encodings.
288310
*/
289
-#define UTF16BE_CR ((wchar_t)'\r')
290
-#define UTF16BE_LF ((wchar_t)'\n')
291
-#define UTF16LE_CR (((wchar_t)'\r')<<(sizeof(wchar_t)<<2))
292
-#define UTF16LE_LF (((wchar_t)'\n')<<(sizeof(wchar_t)<<2))
293
-#define UTF16_FFFF ((wchar_t)-1)
311
+#define UTF16BE_CR ((WCHAR_T)'\r')
312
+#define UTF16BE_LF ((WCHAR_T)'\n')
313
+#define UTF16LE_CR (((WCHAR_T)'\r')<<(sizeof(char)<<3))
314
+#define UTF16LE_LF (((WCHAR_T)'\n')<<(sizeof(char)<<3))
294315
295316
/*
296317
** This function attempts to scan each logical line within the blob to
297318
** determine the type of content it appears to contain. Possible return
298319
** values are:
@@ -308,13 +329,24 @@
308329
**
309330
** (-1) -- The content appears to consist entirely of text, with lines
310331
** delimited by carriage-return, line-feed pairs; however, the
311332
** encoding may not be UTF-16.
312333
**
334
+************************************ WARNING **********************************
335
+**
336
+** This function does not validate that the blob content is properly formed
337
+** UTF-16. It assumes that all code points are the same size. It does not
338
+** validate any code points. It makes no attempt to detect if any [invalid]
339
+** switches between the UTF-16be and UTF-16le encodings occur.
340
+**
341
+** The only code points that this function cares about are the NUL character,
342
+** carriage-return, and line-feed.
343
+**
344
+************************************ WARNING **********************************
313345
*/
314346
int looks_like_utf16(const Blob *pContent){
315
- const wchar_t *z = (wchar_t *)blob_buffer(pContent);
347
+ const WCHAR_T *z = (WCHAR_T *)blob_buffer(pContent);
316348
unsigned int n = blob_size(pContent);
317349
int j, c;
318350
int result = 1; /* Assume UTF-16 text with no CR/NL */
319351
320352
/* Check individual lines.
@@ -324,11 +356,11 @@
324356
c = *z;
325357
if( c==0 ) return 0; /* NUL character in a file -> binary */
326358
j = ((c!=UTF16BE_LF) && (c!=UTF16LE_LF));
327359
while( (n-=2)>0 ){
328360
c = *++z; ++j;
329
- if( c==0 || c==UTF16_FFFF ) return 0; /* NUL/FFFF character in a file -> binary */
361
+ if( c==0 ) return 0; /* NUL character in a file -> binary */
330362
if( c==UTF16BE_LF || c==UTF16LE_LF ){
331363
int c2 = z[-1];
332364
if( c2==UTF16BE_CR || c2==UTF16LE_CR ){
333365
result = -1; /* Contains CR/NL, continue */
334366
}
335367
--- src/diff.c
+++ src/diff.c
@@ -193,10 +193,21 @@
193 **
194 ** (-5) -- The content appears to consist entirely of text, with lines
195 ** delimited by carriage-return, line-feed pairs; however, the
196 ** encoding is not UTF-8 or ASCII.
197 **
 
 
 
 
 
 
 
 
 
 
 
198 */
199
200 int looks_like_utf8(const Blob *pContent){
201 unsigned char *z = (unsigned char *) blob_buffer(pContent);
202 unsigned int n = blob_size(pContent);
@@ -273,26 +284,36 @@
273 }
274 return 1-result; /* No problems seen -> not binary */
275 }
276
277 /*
278 ** Maximum length of a line in a text file, in UTF-16 characters. (2731)
279 ** The number of bytes represented by this value after conversion to
280 ** UTF-8 (which can increase the size by 50%) cannot exceed LENGTH_MASK
 
 
 
 
 
 
 
 
 
 
281 ** bytes, because that is the line buffer size used by the diff engine.
282 */
283 #define UTF16_LENGTH_MASK (LENGTH_MASK/3)
 
284
285 /*
286 ** The carriage-return / line-feed characters in the UTF-16be and UTF-16le
287 ** encodings.
288 */
289 #define UTF16BE_CR ((wchar_t)'\r')
290 #define UTF16BE_LF ((wchar_t)'\n')
291 #define UTF16LE_CR (((wchar_t)'\r')<<(sizeof(wchar_t)<<2))
292 #define UTF16LE_LF (((wchar_t)'\n')<<(sizeof(wchar_t)<<2))
293 #define UTF16_FFFF ((wchar_t)-1)
294
295 /*
296 ** This function attempts to scan each logical line within the blob to
297 ** determine the type of content it appears to contain. Possible return
298 ** values are:
@@ -308,13 +329,24 @@
308 **
309 ** (-1) -- The content appears to consist entirely of text, with lines
310 ** delimited by carriage-return, line-feed pairs; however, the
311 ** encoding may not be UTF-16.
312 **
 
 
 
 
 
 
 
 
 
 
 
313 */
314 int looks_like_utf16(const Blob *pContent){
315 const wchar_t *z = (wchar_t *)blob_buffer(pContent);
316 unsigned int n = blob_size(pContent);
317 int j, c;
318 int result = 1; /* Assume UTF-16 text with no CR/NL */
319
320 /* Check individual lines.
@@ -324,11 +356,11 @@
324 c = *z;
325 if( c==0 ) return 0; /* NUL character in a file -> binary */
326 j = ((c!=UTF16BE_LF) && (c!=UTF16LE_LF));
327 while( (n-=2)>0 ){
328 c = *++z; ++j;
329 if( c==0 || c==UTF16_FFFF ) return 0; /* NUL/FFFF character in a file -> binary */
330 if( c==UTF16BE_LF || c==UTF16LE_LF ){
331 int c2 = z[-1];
332 if( c2==UTF16BE_CR || c2==UTF16LE_CR ){
333 result = -1; /* Contains CR/NL, continue */
334 }
335
--- src/diff.c
+++ src/diff.c
@@ -193,10 +193,21 @@
193 **
194 ** (-5) -- The content appears to consist entirely of text, with lines
195 ** delimited by carriage-return, line-feed pairs; however, the
196 ** encoding is not UTF-8 or ASCII.
197 **
198 ************************************ WARNING **********************************
199 **
200 ** This function does not validate that the blob content is properly formed
201 ** UTF-8. It assumes that all code points are the same size. It does not
202 ** validate any code points. It makes no attempt to detect if any [invalid]
203 ** switches between UTF-8 and other encodings occur.
204 **
205 ** The only code points that this function cares about are the NUL character,
206 ** carriage-return, and line-feed.
207 **
208 ************************************ WARNING **********************************
209 */
210
211 int looks_like_utf8(const Blob *pContent){
212 unsigned char *z = (unsigned char *) blob_buffer(pContent);
213 unsigned int n = blob_size(pContent);
@@ -273,26 +284,36 @@
284 }
285 return 1-result; /* No problems seen -> not binary */
286 }
287
288 /*
289 ** Define the type needed to represent a Unicode (UTF-16) character.
290 */
291 #ifndef WCHAR_T
292 # ifdef _WIN32
293 # define WCHAR_T wchar_t
294 # else
295 # define WCHAR_T unsigned short
296 # endif
297 #endif
298
299 /*
300 ** Maximum length of a line in a text file, in UTF-16 characters. (4096)
301 ** The number of bytes represented by this value cannot exceed LENGTH_MASK
302 ** bytes, because that is the line buffer size used by the diff engine.
303 */
304 #define UTF16_LENGTH_MASK_SZ (LENGTH_MASK_SZ-(sizeof(WCHAR_T)-sizeof(char)))
305 #define UTF16_LENGTH_MASK ((1<<UTF16_LENGTH_MASK_SZ)-1)
306
307 /*
308 ** The carriage-return / line-feed characters in the UTF-16be and UTF-16le
309 ** encodings.
310 */
311 #define UTF16BE_CR ((WCHAR_T)'\r')
312 #define UTF16BE_LF ((WCHAR_T)'\n')
313 #define UTF16LE_CR (((WCHAR_T)'\r')<<(sizeof(char)<<3))
314 #define UTF16LE_LF (((WCHAR_T)'\n')<<(sizeof(char)<<3))
 
315
316 /*
317 ** This function attempts to scan each logical line within the blob to
318 ** determine the type of content it appears to contain. Possible return
319 ** values are:
@@ -308,13 +329,24 @@
329 **
330 ** (-1) -- The content appears to consist entirely of text, with lines
331 ** delimited by carriage-return, line-feed pairs; however, the
332 ** encoding may not be UTF-16.
333 **
334 ************************************ WARNING **********************************
335 **
336 ** This function does not validate that the blob content is properly formed
337 ** UTF-16. It assumes that all code points are the same size. It does not
338 ** validate any code points. It makes no attempt to detect if any [invalid]
339 ** switches between the UTF-16be and UTF-16le encodings occur.
340 **
341 ** The only code points that this function cares about are the NUL character,
342 ** carriage-return, and line-feed.
343 **
344 ************************************ WARNING **********************************
345 */
346 int looks_like_utf16(const Blob *pContent){
347 const WCHAR_T *z = (WCHAR_T *)blob_buffer(pContent);
348 unsigned int n = blob_size(pContent);
349 int j, c;
350 int result = 1; /* Assume UTF-16 text with no CR/NL */
351
352 /* Check individual lines.
@@ -324,11 +356,11 @@
356 c = *z;
357 if( c==0 ) return 0; /* NUL character in a file -> binary */
358 j = ((c!=UTF16BE_LF) && (c!=UTF16LE_LF));
359 while( (n-=2)>0 ){
360 c = *++z; ++j;
361 if( c==0 ) return 0; /* NUL character in a file -> binary */
362 if( c==UTF16BE_LF || c==UTF16LE_LF ){
363 int c2 = z[-1];
364 if( c2==UTF16BE_CR || c2==UTF16LE_CR ){
365 result = -1; /* Contains CR/NL, continue */
366 }
367
+4 -4
--- src/main.c
+++ src/main.c
@@ -341,11 +341,11 @@
341341
if(g.db){
342342
db_close(0);
343343
}
344344
}
345345
346
-#if defined(_WIN32)
346
+#if defined(_WIN32) && !defined(__MINGW32__)
347347
/*
348348
** Parse the command-line arguments passed to windows. We do this
349349
** ourselves to work around bugs in the command-line parsing of MinGW.
350350
** It is possible (in theory) to only use this routine when compiling
351351
** with MinGW and to use built-in command-line parsing for MSVC and
@@ -454,11 +454,11 @@
454454
}
455455
argv[argc] = NULL;
456456
*argcPtr = argc;
457457
*((WCHAR ***)argvPtr) = argv;
458458
}
459
-#endif /* defined(_WIN32) */
459
+#endif /* defined(_WIN32) && !defined(__MINGW32__) */
460460
461461
462462
/*
463463
** Convert all arguments from mbcs (or unicode) to UTF-8. Then
464464
** search g.argv for arguments "--args FILENAME". If found, then
@@ -478,17 +478,17 @@
478478
int n; /* Number of bytes in one line */
479479
char *z; /* General use string pointer */
480480
char **newArgv; /* New expanded g.argv under construction */
481481
char const * zFileName; /* input file name */
482482
FILE * zInFile; /* input FILE */
483
-#ifdef _WIN32
483
+#if defined(_WIN32) && !defined(__MINGW32__)
484484
WCHAR buf[MAX_PATH];
485485
#endif
486486
487487
g.argc = argc;
488488
g.argv = argv;
489
-#ifdef _WIN32
489
+#if defined(_WIN32) && !defined(__MINGW32__)
490490
parse_windows_command_line(&g.argc, &g.argv);
491491
GetModuleFileNameW(NULL, buf, MAX_PATH);
492492
g.nameOfExe = fossil_unicode_to_utf8(buf);
493493
for(i=0; i<g.argc; i++) g.argv[i] = fossil_unicode_to_utf8(g.argv[i]);
494494
#else
495495
--- src/main.c
+++ src/main.c
@@ -341,11 +341,11 @@
341 if(g.db){
342 db_close(0);
343 }
344 }
345
346 #if defined(_WIN32)
347 /*
348 ** Parse the command-line arguments passed to windows. We do this
349 ** ourselves to work around bugs in the command-line parsing of MinGW.
350 ** It is possible (in theory) to only use this routine when compiling
351 ** with MinGW and to use built-in command-line parsing for MSVC and
@@ -454,11 +454,11 @@
454 }
455 argv[argc] = NULL;
456 *argcPtr = argc;
457 *((WCHAR ***)argvPtr) = argv;
458 }
459 #endif /* defined(_WIN32) */
460
461
462 /*
463 ** Convert all arguments from mbcs (or unicode) to UTF-8. Then
464 ** search g.argv for arguments "--args FILENAME". If found, then
@@ -478,17 +478,17 @@
478 int n; /* Number of bytes in one line */
479 char *z; /* General use string pointer */
480 char **newArgv; /* New expanded g.argv under construction */
481 char const * zFileName; /* input file name */
482 FILE * zInFile; /* input FILE */
483 #ifdef _WIN32
484 WCHAR buf[MAX_PATH];
485 #endif
486
487 g.argc = argc;
488 g.argv = argv;
489 #ifdef _WIN32
490 parse_windows_command_line(&g.argc, &g.argv);
491 GetModuleFileNameW(NULL, buf, MAX_PATH);
492 g.nameOfExe = fossil_unicode_to_utf8(buf);
493 for(i=0; i<g.argc; i++) g.argv[i] = fossil_unicode_to_utf8(g.argv[i]);
494 #else
495
--- src/main.c
+++ src/main.c
@@ -341,11 +341,11 @@
341 if(g.db){
342 db_close(0);
343 }
344 }
345
346 #if defined(_WIN32) && !defined(__MINGW32__)
347 /*
348 ** Parse the command-line arguments passed to windows. We do this
349 ** ourselves to work around bugs in the command-line parsing of MinGW.
350 ** It is possible (in theory) to only use this routine when compiling
351 ** with MinGW and to use built-in command-line parsing for MSVC and
@@ -454,11 +454,11 @@
454 }
455 argv[argc] = NULL;
456 *argcPtr = argc;
457 *((WCHAR ***)argvPtr) = argv;
458 }
459 #endif /* defined(_WIN32) && !defined(__MINGW32__) */
460
461
462 /*
463 ** Convert all arguments from mbcs (or unicode) to UTF-8. Then
464 ** search g.argv for arguments "--args FILENAME". If found, then
@@ -478,17 +478,17 @@
478 int n; /* Number of bytes in one line */
479 char *z; /* General use string pointer */
480 char **newArgv; /* New expanded g.argv under construction */
481 char const * zFileName; /* input file name */
482 FILE * zInFile; /* input FILE */
483 #if defined(_WIN32) && !defined(__MINGW32__)
484 WCHAR buf[MAX_PATH];
485 #endif
486
487 g.argc = argc;
488 g.argv = argv;
489 #if defined(_WIN32) && !defined(__MINGW32__)
490 parse_windows_command_line(&g.argc, &g.argv);
491 GetModuleFileNameW(NULL, buf, MAX_PATH);
492 g.nameOfExe = fossil_unicode_to_utf8(buf);
493 for(i=0; i<g.argc; i++) g.argv[i] = fossil_unicode_to_utf8(g.argv[i]);
494 #else
495
+1
--- src/md5.c
+++ src/md5.c
@@ -433,10 +433,11 @@
433433
int i;
434434
Blob in;
435435
Blob cksum;
436436
437437
for(i=2; i<g.argc; i++){
438
+ blob_init(&cksum, "********** not found ***********", -1);
438439
if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
439440
blob_read_from_channel(&in, stdin, -1);
440441
md5sum_blob(&in, &cksum);
441442
}else{
442443
md5sum_file(g.argv[i], &cksum);
443444
--- src/md5.c
+++ src/md5.c
@@ -433,10 +433,11 @@
433 int i;
434 Blob in;
435 Blob cksum;
436
437 for(i=2; i<g.argc; i++){
 
438 if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
439 blob_read_from_channel(&in, stdin, -1);
440 md5sum_blob(&in, &cksum);
441 }else{
442 md5sum_file(g.argv[i], &cksum);
443
--- src/md5.c
+++ src/md5.c
@@ -433,10 +433,11 @@
433 int i;
434 Blob in;
435 Blob cksum;
436
437 for(i=2; i<g.argc; i++){
438 blob_init(&cksum, "********** not found ***********", -1);
439 if( g.argv[i][0]=='-' && g.argv[i][1]==0 ){
440 blob_read_from_channel(&in, stdin, -1);
441 md5sum_blob(&in, &cksum);
442 }else{
443 md5sum_file(g.argv[i], &cksum);
444
+19 -6
--- src/timeline.c
+++ src/timeline.c
@@ -202,10 +202,11 @@
202202
GraphContext *pGraph = 0;
203203
int prevWasDivider = 0; /* True if previous output row was <hr> */
204204
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
205205
Stmt fchngQuery; /* Query for file changes on check-ins */
206206
static Stmt qbranch;
207
+ int pendingEndTr = 0; /* True if a </td></tr> is needed */
207208
208209
zPrevDate[0] = 0;
209210
mxWikiLen = db_get_int("timeline-max-comment", 0);
210211
if( db_get_boolean("timeline-block-markup", 0) ){
211212
wikiFlags = WIKI_INLINE;
@@ -253,14 +254,17 @@
253254
}
254255
}
255256
}
256257
prevTagid = tagid;
257258
if( suppressCnt ){
258
- @ <tr><td /><td /><td>
259259
@ <span class="timelineDisabled">... %d(suppressCnt) similar
260260
@ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
261261
suppressCnt = 0;
262
+ }
263
+ if( pendingEndTr ){
264
+ @ </td></tr>
265
+ pendingEndTr = 0;
262266
}
263267
if( fossil_strcmp(zType,"div")==0 ){
264268
if( !prevWasDivider ){
265269
@ <tr><td colspan="3"><hr /></td></tr>
266270
}
@@ -461,17 +465,19 @@
461465
db_reset(&fchngQuery);
462466
if( inUl ){
463467
@ </ul>
464468
}
465469
}
466
- @ </td></tr>
470
+ pendingEndTr = 1;
467471
}
468472
if( suppressCnt ){
469
- @ <tr><td /><td /><td>
470473
@ <span class="timelineDisabled">... %d(suppressCnt) similar
471474
@ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
472475
suppressCnt = 0;
476
+ }
477
+ if( pendingEndTr ){
478
+ @ </td></tr>
473479
}
474480
if( pGraph ){
475481
graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
476482
if( pGraph->nErr ){
477483
graph_free(pGraph);
@@ -941,10 +947,11 @@
941947
login_check_credentials();
942948
if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
943949
login_needed();
944950
return;
945951
}
952
+ url_initialize(&url, "timeline");
946953
if( zTagName && g.perm.Read ){
947954
tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
948955
zThisTag = zTagName;
949956
}else if( zBrName && g.perm.Read ){
950957
tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
@@ -957,22 +964,28 @@
957964
}else{
958965
tmFlags = TIMELINE_GRAPH;
959966
}
960967
if( P("ng")!=0 || zSearch!=0 ){
961968
tmFlags &= ~TIMELINE_GRAPH;
969
+ url_add_parameter(&url, "ng", 0);
970
+ }
971
+ if( P("brbg")!=0 ){
972
+ tmFlags |= TIMELINE_BRCOLOR;
973
+ url_add_parameter(&url, "brbg", 0);
962974
}
963
- if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
964
- if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
975
+ if( P("ubg")!=0 ){
976
+ tmFlags |= TIMELINE_UCOLOR;
977
+ url_add_parameter(&url, "ubg", 0);
978
+ }
965979
966980
style_header("Timeline");
967981
login_anonymous_available();
968982
timeline_temp_table();
969983
blob_zero(&sql);
970984
blob_zero(&desc);
971985
blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
972986
blob_append(&sql, timeline_query_for_www(), -1);
973
- url_initialize(&url, "timeline");
974987
if( P("fc")!=0 || P("detail")!=0 ){
975988
tmFlags |= TIMELINE_FCHANGES;
976989
url_add_parameter(&url, "fc", 0);
977990
}
978991
if( !useDividers ) url_add_parameter(&url, "nd", 0);
979992
--- src/timeline.c
+++ src/timeline.c
@@ -202,10 +202,11 @@
202 GraphContext *pGraph = 0;
203 int prevWasDivider = 0; /* True if previous output row was <hr> */
204 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
205 Stmt fchngQuery; /* Query for file changes on check-ins */
206 static Stmt qbranch;
 
207
208 zPrevDate[0] = 0;
209 mxWikiLen = db_get_int("timeline-max-comment", 0);
210 if( db_get_boolean("timeline-block-markup", 0) ){
211 wikiFlags = WIKI_INLINE;
@@ -253,14 +254,17 @@
253 }
254 }
255 }
256 prevTagid = tagid;
257 if( suppressCnt ){
258 @ <tr><td /><td /><td>
259 @ <span class="timelineDisabled">... %d(suppressCnt) similar
260 @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
261 suppressCnt = 0;
 
 
 
 
262 }
263 if( fossil_strcmp(zType,"div")==0 ){
264 if( !prevWasDivider ){
265 @ <tr><td colspan="3"><hr /></td></tr>
266 }
@@ -461,17 +465,19 @@
461 db_reset(&fchngQuery);
462 if( inUl ){
463 @ </ul>
464 }
465 }
466 @ </td></tr>
467 }
468 if( suppressCnt ){
469 @ <tr><td /><td /><td>
470 @ <span class="timelineDisabled">... %d(suppressCnt) similar
471 @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
472 suppressCnt = 0;
 
 
 
473 }
474 if( pGraph ){
475 graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
476 if( pGraph->nErr ){
477 graph_free(pGraph);
@@ -941,10 +947,11 @@
941 login_check_credentials();
942 if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
943 login_needed();
944 return;
945 }
 
946 if( zTagName && g.perm.Read ){
947 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
948 zThisTag = zTagName;
949 }else if( zBrName && g.perm.Read ){
950 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
@@ -957,22 +964,28 @@
957 }else{
958 tmFlags = TIMELINE_GRAPH;
959 }
960 if( P("ng")!=0 || zSearch!=0 ){
961 tmFlags &= ~TIMELINE_GRAPH;
 
 
 
 
 
962 }
963 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
964 if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
 
 
965
966 style_header("Timeline");
967 login_anonymous_available();
968 timeline_temp_table();
969 blob_zero(&sql);
970 blob_zero(&desc);
971 blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
972 blob_append(&sql, timeline_query_for_www(), -1);
973 url_initialize(&url, "timeline");
974 if( P("fc")!=0 || P("detail")!=0 ){
975 tmFlags |= TIMELINE_FCHANGES;
976 url_add_parameter(&url, "fc", 0);
977 }
978 if( !useDividers ) url_add_parameter(&url, "nd", 0);
979
--- src/timeline.c
+++ src/timeline.c
@@ -202,10 +202,11 @@
202 GraphContext *pGraph = 0;
203 int prevWasDivider = 0; /* True if previous output row was <hr> */
204 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
205 Stmt fchngQuery; /* Query for file changes on check-ins */
206 static Stmt qbranch;
207 int pendingEndTr = 0; /* True if a </td></tr> is needed */
208
209 zPrevDate[0] = 0;
210 mxWikiLen = db_get_int("timeline-max-comment", 0);
211 if( db_get_boolean("timeline-block-markup", 0) ){
212 wikiFlags = WIKI_INLINE;
@@ -253,14 +254,17 @@
254 }
255 }
256 }
257 prevTagid = tagid;
258 if( suppressCnt ){
 
259 @ <span class="timelineDisabled">... %d(suppressCnt) similar
260 @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
261 suppressCnt = 0;
262 }
263 if( pendingEndTr ){
264 @ </td></tr>
265 pendingEndTr = 0;
266 }
267 if( fossil_strcmp(zType,"div")==0 ){
268 if( !prevWasDivider ){
269 @ <tr><td colspan="3"><hr /></td></tr>
270 }
@@ -461,17 +465,19 @@
465 db_reset(&fchngQuery);
466 if( inUl ){
467 @ </ul>
468 }
469 }
470 pendingEndTr = 1;
471 }
472 if( suppressCnt ){
 
473 @ <span class="timelineDisabled">... %d(suppressCnt) similar
474 @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
475 suppressCnt = 0;
476 }
477 if( pendingEndTr ){
478 @ </td></tr>
479 }
480 if( pGraph ){
481 graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
482 if( pGraph->nErr ){
483 graph_free(pGraph);
@@ -941,10 +947,11 @@
947 login_check_credentials();
948 if( !g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki ){
949 login_needed();
950 return;
951 }
952 url_initialize(&url, "timeline");
953 if( zTagName && g.perm.Read ){
954 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName);
955 zThisTag = zTagName;
956 }else if( zBrName && g.perm.Read ){
957 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName);
@@ -957,22 +964,28 @@
964 }else{
965 tmFlags = TIMELINE_GRAPH;
966 }
967 if( P("ng")!=0 || zSearch!=0 ){
968 tmFlags &= ~TIMELINE_GRAPH;
969 url_add_parameter(&url, "ng", 0);
970 }
971 if( P("brbg")!=0 ){
972 tmFlags |= TIMELINE_BRCOLOR;
973 url_add_parameter(&url, "brbg", 0);
974 }
975 if( P("ubg")!=0 ){
976 tmFlags |= TIMELINE_UCOLOR;
977 url_add_parameter(&url, "ubg", 0);
978 }
979
980 style_header("Timeline");
981 login_anonymous_available();
982 timeline_temp_table();
983 blob_zero(&sql);
984 blob_zero(&desc);
985 blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
986 blob_append(&sql, timeline_query_for_www(), -1);
 
987 if( P("fc")!=0 || P("detail")!=0 ){
988 tmFlags |= TIMELINE_FCHANGES;
989 url_add_parameter(&url, "fc", 0);
990 }
991 if( !useDividers ) url_add_parameter(&url, "nd", 0);
992

Keyboard Shortcuts

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