Fossil SCM

Merge enhancements from trunk

drh 2017-03-04 20:04 fossil-2.1 merge
Commit acd3b31f757397e26f53fbed537174ad1bcec639
+21 -7
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -151,10 +151,13 @@
151151
/*
152152
** Show the difference between two files, one in memory and one on disk.
153153
**
154154
** The difference is the set of edits needed to transform pFile1 into
155155
** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
156
+**
157
+** If fSwapDiff is 1, show the set of edits to transform zFile2 into pFile1
158
+** instead of the opposite.
156159
**
157160
** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
158161
** command zDiffCmd to do the diffing.
159162
**
160163
** When using an external diff program, zBinGlob contains the GLOB patterns
@@ -167,11 +170,12 @@
167170
const char *zFile2, /* On disk content to compare to */
168171
const char *zName, /* Display name of the file */
169172
const char *zDiffCmd, /* Command for comparison */
170173
const char *zBinGlob, /* Treat file names matching this as binary */
171174
int fIncludeBinary, /* Include binary files for external diff */
172
- u64 diffFlags /* Flags to control the diff */
175
+ u64 diffFlags, /* Flags to control the diff */
176
+ int fSwapDiff /* Diff from Zfile2 to Pfile1 */
173177
){
174178
if( zDiffCmd==0 ){
175179
Blob out; /* Diff output text */
176180
Blob file2; /* Content of zFile2 */
177181
const char *zName2; /* Name of zFile2 for display */
@@ -194,11 +198,15 @@
194198
if( blob_compare(pFile1, &file2) ){
195199
fossil_print("CHANGED %s\n", zName);
196200
}
197201
}else{
198202
blob_zero(&out);
199
- text_diff(pFile1, &file2, &out, 0, diffFlags);
203
+ if( fSwapDiff ){
204
+ text_diff(&file2, pFile1, &out, 0, diffFlags);
205
+ }else{
206
+ text_diff(pFile1, &file2, &out, 0, diffFlags);
207
+ }
200208
if( blob_size(&out) ){
201209
diff_print_filenames(zName, zName2, diffFlags);
202210
fossil_print("%s\n", blob_str(&out));
203211
}
204212
blob_reset(&out);
@@ -252,13 +260,19 @@
252260
blob_write_to_file(pFile1, blob_str(&nameFile1));
253261
254262
/* Construct the external diff command */
255263
blob_zero(&cmd);
256264
blob_appendf(&cmd, "%s ", zDiffCmd);
257
- shell_escape(&cmd, blob_str(&nameFile1));
258
- blob_append(&cmd, " ", 1);
259
- shell_escape(&cmd, zFile2);
265
+ if( fSwapDiff ){
266
+ shell_escape(&cmd, zFile2);
267
+ blob_append(&cmd, " ", 1);
268
+ shell_escape(&cmd, blob_str(&nameFile1));
269
+ }else{
270
+ shell_escape(&cmd, blob_str(&nameFile1));
271
+ blob_append(&cmd, " ", 1);
272
+ shell_escape(&cmd, zFile2);
273
+ }
260274
261275
/* Run the external diff command */
262276
fossil_system(blob_str(&cmd));
263277
264278
/* Delete the temporary file and clean up memory used */
@@ -482,11 +496,11 @@
482496
blob_zero(&content);
483497
}
484498
isBin = fIncludeBinary ? 0 : looks_like_binary(&content);
485499
diff_print_index(zPathname, diffFlags);
486500
diff_file(&content, isBin, zFullName, zPathname, zDiffCmd,
487
- zBinGlob, fIncludeBinary, diffFlags);
501
+ zBinGlob, fIncludeBinary, diffFlags, 0);
488502
blob_reset(&content);
489503
}
490504
blob_reset(&fname);
491505
}
492506
db_finalize(&q);
@@ -519,11 +533,11 @@
519533
const char *zFile = (const char*)db_column_text(&q, 0);
520534
if( !file_dir_match(pFileDir, zFile) ) continue;
521535
zFullName = mprintf("%s%s", g.zLocalRoot, zFile);
522536
db_column_blob(&q, 1, &content);
523537
diff_file(&content, 0, zFullName, zFile,
524
- zDiffCmd, zBinGlob, fIncludeBinary, diffFlags);
538
+ zDiffCmd, zBinGlob, fIncludeBinary, diffFlags, 0);
525539
fossil_free(zFullName);
526540
blob_reset(&content);
527541
}
528542
db_finalize(&q);
529543
}
530544
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -151,10 +151,13 @@
151 /*
152 ** Show the difference between two files, one in memory and one on disk.
153 **
154 ** The difference is the set of edits needed to transform pFile1 into
155 ** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
 
 
 
156 **
157 ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
158 ** command zDiffCmd to do the diffing.
159 **
160 ** When using an external diff program, zBinGlob contains the GLOB patterns
@@ -167,11 +170,12 @@
167 const char *zFile2, /* On disk content to compare to */
168 const char *zName, /* Display name of the file */
169 const char *zDiffCmd, /* Command for comparison */
170 const char *zBinGlob, /* Treat file names matching this as binary */
171 int fIncludeBinary, /* Include binary files for external diff */
172 u64 diffFlags /* Flags to control the diff */
 
173 ){
174 if( zDiffCmd==0 ){
175 Blob out; /* Diff output text */
176 Blob file2; /* Content of zFile2 */
177 const char *zName2; /* Name of zFile2 for display */
@@ -194,11 +198,15 @@
194 if( blob_compare(pFile1, &file2) ){
195 fossil_print("CHANGED %s\n", zName);
196 }
197 }else{
198 blob_zero(&out);
199 text_diff(pFile1, &file2, &out, 0, diffFlags);
 
 
 
 
200 if( blob_size(&out) ){
201 diff_print_filenames(zName, zName2, diffFlags);
202 fossil_print("%s\n", blob_str(&out));
203 }
204 blob_reset(&out);
@@ -252,13 +260,19 @@
252 blob_write_to_file(pFile1, blob_str(&nameFile1));
253
254 /* Construct the external diff command */
255 blob_zero(&cmd);
256 blob_appendf(&cmd, "%s ", zDiffCmd);
257 shell_escape(&cmd, blob_str(&nameFile1));
258 blob_append(&cmd, " ", 1);
259 shell_escape(&cmd, zFile2);
 
 
 
 
 
 
260
261 /* Run the external diff command */
262 fossil_system(blob_str(&cmd));
263
264 /* Delete the temporary file and clean up memory used */
@@ -482,11 +496,11 @@
482 blob_zero(&content);
483 }
484 isBin = fIncludeBinary ? 0 : looks_like_binary(&content);
485 diff_print_index(zPathname, diffFlags);
486 diff_file(&content, isBin, zFullName, zPathname, zDiffCmd,
487 zBinGlob, fIncludeBinary, diffFlags);
488 blob_reset(&content);
489 }
490 blob_reset(&fname);
491 }
492 db_finalize(&q);
@@ -519,11 +533,11 @@
519 const char *zFile = (const char*)db_column_text(&q, 0);
520 if( !file_dir_match(pFileDir, zFile) ) continue;
521 zFullName = mprintf("%s%s", g.zLocalRoot, zFile);
522 db_column_blob(&q, 1, &content);
523 diff_file(&content, 0, zFullName, zFile,
524 zDiffCmd, zBinGlob, fIncludeBinary, diffFlags);
525 fossil_free(zFullName);
526 blob_reset(&content);
527 }
528 db_finalize(&q);
529 }
530
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -151,10 +151,13 @@
151 /*
152 ** Show the difference between two files, one in memory and one on disk.
153 **
154 ** The difference is the set of edits needed to transform pFile1 into
155 ** zFile2. The content of pFile1 is in memory. zFile2 exists on disk.
156 **
157 ** If fSwapDiff is 1, show the set of edits to transform zFile2 into pFile1
158 ** instead of the opposite.
159 **
160 ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the
161 ** command zDiffCmd to do the diffing.
162 **
163 ** When using an external diff program, zBinGlob contains the GLOB patterns
@@ -167,11 +170,12 @@
170 const char *zFile2, /* On disk content to compare to */
171 const char *zName, /* Display name of the file */
172 const char *zDiffCmd, /* Command for comparison */
173 const char *zBinGlob, /* Treat file names matching this as binary */
174 int fIncludeBinary, /* Include binary files for external diff */
175 u64 diffFlags, /* Flags to control the diff */
176 int fSwapDiff /* Diff from Zfile2 to Pfile1 */
177 ){
178 if( zDiffCmd==0 ){
179 Blob out; /* Diff output text */
180 Blob file2; /* Content of zFile2 */
181 const char *zName2; /* Name of zFile2 for display */
@@ -194,11 +198,15 @@
198 if( blob_compare(pFile1, &file2) ){
199 fossil_print("CHANGED %s\n", zName);
200 }
201 }else{
202 blob_zero(&out);
203 if( fSwapDiff ){
204 text_diff(&file2, pFile1, &out, 0, diffFlags);
205 }else{
206 text_diff(pFile1, &file2, &out, 0, diffFlags);
207 }
208 if( blob_size(&out) ){
209 diff_print_filenames(zName, zName2, diffFlags);
210 fossil_print("%s\n", blob_str(&out));
211 }
212 blob_reset(&out);
@@ -252,13 +260,19 @@
260 blob_write_to_file(pFile1, blob_str(&nameFile1));
261
262 /* Construct the external diff command */
263 blob_zero(&cmd);
264 blob_appendf(&cmd, "%s ", zDiffCmd);
265 if( fSwapDiff ){
266 shell_escape(&cmd, zFile2);
267 blob_append(&cmd, " ", 1);
268 shell_escape(&cmd, blob_str(&nameFile1));
269 }else{
270 shell_escape(&cmd, blob_str(&nameFile1));
271 blob_append(&cmd, " ", 1);
272 shell_escape(&cmd, zFile2);
273 }
274
275 /* Run the external diff command */
276 fossil_system(blob_str(&cmd));
277
278 /* Delete the temporary file and clean up memory used */
@@ -482,11 +496,11 @@
496 blob_zero(&content);
497 }
498 isBin = fIncludeBinary ? 0 : looks_like_binary(&content);
499 diff_print_index(zPathname, diffFlags);
500 diff_file(&content, isBin, zFullName, zPathname, zDiffCmd,
501 zBinGlob, fIncludeBinary, diffFlags, 0);
502 blob_reset(&content);
503 }
504 blob_reset(&fname);
505 }
506 db_finalize(&q);
@@ -519,11 +533,11 @@
533 const char *zFile = (const char*)db_column_text(&q, 0);
534 if( !file_dir_match(pFileDir, zFile) ) continue;
535 zFullName = mprintf("%s%s", g.zLocalRoot, zFile);
536 db_column_blob(&q, 1, &content);
537 diff_file(&content, 0, zFullName, zFile,
538 zDiffCmd, zBinGlob, fIncludeBinary, diffFlags, 0);
539 fossil_free(zFullName);
540 blob_reset(&content);
541 }
542 db_finalize(&q);
543 }
544
+1 -1
--- src/doc.c
+++ src/doc.c
@@ -735,11 +735,11 @@
735735
736736
/* Jump here when unable to locate the document */
737737
doc_not_found:
738738
db_end_transaction(0);
739739
if( isUV && P("name")==0 ){
740
- uvstat_page();
740
+ uvlist_page();
741741
return;
742742
}
743743
cgi_set_status(404, "Not Found");
744744
style_header("Not Found");
745745
@ <p>Document %h(zOrigName) not found
746746
--- src/doc.c
+++ src/doc.c
@@ -735,11 +735,11 @@
735
736 /* Jump here when unable to locate the document */
737 doc_not_found:
738 db_end_transaction(0);
739 if( isUV && P("name")==0 ){
740 uvstat_page();
741 return;
742 }
743 cgi_set_status(404, "Not Found");
744 style_header("Not Found");
745 @ <p>Document %h(zOrigName) not found
746
--- src/doc.c
+++ src/doc.c
@@ -735,11 +735,11 @@
735
736 /* Jump here when unable to locate the document */
737 doc_not_found:
738 db_end_transaction(0);
739 if( isUV && P("name")==0 ){
740 uvlist_page();
741 return;
742 }
743 cgi_set_status(404, "Not Found");
744 style_header("Not Found");
745 @ <p>Document %h(zOrigName) not found
746
+90
--- src/encode.c
+++ src/encode.c
@@ -336,10 +336,100 @@
336336
z[j++] = c;
337337
}
338338
if( z[j] ) z[j] = 0;
339339
}
340340
341
+
342
+/*
343
+** The *pz variable points to a UTF8 string. Read the next character
344
+** off of that string and return its codepoint value. Advance *pz to the
345
+** next character
346
+*/
347
+u32 fossil_utf8_read(
348
+ const unsigned char **pz /* Pointer to string from which to read char */
349
+){
350
+ unsigned int c;
351
+
352
+ /*
353
+ ** This lookup table is used to help decode the first byte of
354
+ ** a multi-byte UTF8 character.
355
+ */
356
+ static const unsigned char utf8Trans1[] = {
357
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
358
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
359
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
360
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
361
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
362
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
363
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
364
+ 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00,
365
+ };
366
+
367
+ c = *((*pz)++);
368
+ if( c>=0xc0 ){
369
+ c = utf8Trans1[c-0xc0];
370
+ while( (*(*pz) & 0xc0)==0x80 ){
371
+ c = (c<<6) + (0x3f & *((*pz)++));
372
+ }
373
+ if( c<0x80
374
+ || (c&0xFFFFF800)==0xD800
375
+ || (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; }
376
+ }
377
+ return c;
378
+}
379
+
380
+/*
381
+** Encode a UTF8 string for JSON. All special characters are escaped.
382
+*/
383
+void blob_append_json_string(Blob *pBlob, const char *zStr){
384
+ const unsigned char *z;
385
+ char *zOut;
386
+ u32 c;
387
+ int n, i, j;
388
+ z = (const unsigned char*)zStr;
389
+ n = 0;
390
+ while( (c = fossil_utf8_read(&z))!=0 ){
391
+ if( c=='\\' || c=='"' ){
392
+ n += 2;
393
+ }else if( c<' ' || c>=0x7f ){
394
+ if( c=='\n' || c=='\r' ){
395
+ n += 2;
396
+ }else{
397
+ n += 6;
398
+ }
399
+ }else{
400
+ n++;
401
+ }
402
+ }
403
+ i = blob_size(pBlob);
404
+ blob_resize(pBlob, i+n);
405
+ zOut = blob_buffer(pBlob);
406
+ z = (const unsigned char*)zStr;
407
+ while( (c = fossil_utf8_read(&z))!=0 ){
408
+ if( c=='\\' ){
409
+ zOut[i++] = '\\';
410
+ zOut[i++] = c;
411
+ }else if( c<' ' || c>=0x7f ){
412
+ zOut[i++] = '\\';
413
+ if( c=='\n' ){
414
+ zOut[i++] = 'n';
415
+ }else if( c=='\r' ){
416
+ zOut[i++] = 'r';
417
+ }else{
418
+ zOut[i++] = 'u';
419
+ for(j=3; j>=0; j--){
420
+ zOut[i+j] = "0123456789abcdef"[c&0xf];
421
+ c >>= 4;
422
+ }
423
+ i += 4;
424
+ }
425
+ }else{
426
+ zOut[i++] = c;
427
+ }
428
+ }
429
+ zOut[i] = 0;
430
+}
341431
342432
/*
343433
** The characters used for HTTP base64 encoding.
344434
*/
345435
static unsigned char zBase[] =
346436
--- src/encode.c
+++ src/encode.c
@@ -336,10 +336,100 @@
336 z[j++] = c;
337 }
338 if( z[j] ) z[j] = 0;
339 }
340
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
342 /*
343 ** The characters used for HTTP base64 encoding.
344 */
345 static unsigned char zBase[] =
346
--- src/encode.c
+++ src/encode.c
@@ -336,10 +336,100 @@
336 z[j++] = c;
337 }
338 if( z[j] ) z[j] = 0;
339 }
340
341
342 /*
343 ** The *pz variable points to a UTF8 string. Read the next character
344 ** off of that string and return its codepoint value. Advance *pz to the
345 ** next character
346 */
347 u32 fossil_utf8_read(
348 const unsigned char **pz /* Pointer to string from which to read char */
349 ){
350 unsigned int c;
351
352 /*
353 ** This lookup table is used to help decode the first byte of
354 ** a multi-byte UTF8 character.
355 */
356 static const unsigned char utf8Trans1[] = {
357 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
358 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
359 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
360 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
361 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
362 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
363 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
364 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00,
365 };
366
367 c = *((*pz)++);
368 if( c>=0xc0 ){
369 c = utf8Trans1[c-0xc0];
370 while( (*(*pz) & 0xc0)==0x80 ){
371 c = (c<<6) + (0x3f & *((*pz)++));
372 }
373 if( c<0x80
374 || (c&0xFFFFF800)==0xD800
375 || (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; }
376 }
377 return c;
378 }
379
380 /*
381 ** Encode a UTF8 string for JSON. All special characters are escaped.
382 */
383 void blob_append_json_string(Blob *pBlob, const char *zStr){
384 const unsigned char *z;
385 char *zOut;
386 u32 c;
387 int n, i, j;
388 z = (const unsigned char*)zStr;
389 n = 0;
390 while( (c = fossil_utf8_read(&z))!=0 ){
391 if( c=='\\' || c=='"' ){
392 n += 2;
393 }else if( c<' ' || c>=0x7f ){
394 if( c=='\n' || c=='\r' ){
395 n += 2;
396 }else{
397 n += 6;
398 }
399 }else{
400 n++;
401 }
402 }
403 i = blob_size(pBlob);
404 blob_resize(pBlob, i+n);
405 zOut = blob_buffer(pBlob);
406 z = (const unsigned char*)zStr;
407 while( (c = fossil_utf8_read(&z))!=0 ){
408 if( c=='\\' ){
409 zOut[i++] = '\\';
410 zOut[i++] = c;
411 }else if( c<' ' || c>=0x7f ){
412 zOut[i++] = '\\';
413 if( c=='\n' ){
414 zOut[i++] = 'n';
415 }else if( c=='\r' ){
416 zOut[i++] = 'r';
417 }else{
418 zOut[i++] = 'u';
419 for(j=3; j>=0; j--){
420 zOut[i+j] = "0123456789abcdef"[c&0xf];
421 c >>= 4;
422 }
423 i += 4;
424 }
425 }else{
426 zOut[i++] = c;
427 }
428 }
429 zOut[i] = 0;
430 }
431
432 /*
433 ** The characters used for HTTP base64 encoding.
434 */
435 static unsigned char zBase[] =
436
+3 -3
--- src/hname.c
+++ src/hname.c
@@ -60,11 +60,11 @@
6060
if( nHash==HNAME_LEN_K256 ) return "SHA3-256";
6161
return "?";
6262
}
6363
6464
/*
65
-** Return the integer hash algorithm code number (ex: HNAME_K224) for
65
+** Return the integer hash algorithm code number (ex: HNAME_K256) for
6666
** the hash string provided. Or return HNAME_ERROR (0) if the input string
6767
** is not a valid artifact hash string.
6868
*/
6969
int hname_validate(const char *zHash, int nHash){
7070
int id;
@@ -82,11 +82,11 @@
8282
** Return true if the hash is correct. Return false if the content
8383
** does not match the hash.
8484
**
8585
** Actually, the returned value is one of the hash algorithm constants
8686
** corresponding to the hash that matched if the hash is correct.
87
-** (Examples: HNAME_SHA1 or HNAME_K224). And the return is HNAME_ERROR
87
+** (Examples: HNAME_SHA1 or HNAME_K256). And the return is HNAME_ERROR
8888
** if the hash does not match.
8989
*/
9090
int hname_verify_hash(Blob *pContent, const char *zHash, int nHash){
9191
int id = HNAME_ERROR;
9292
switch( nHash ){
@@ -114,11 +114,11 @@
114114
** Return true if the hash is correct. Return false if the content
115115
** does not match the hash.
116116
**
117117
** Actually, the returned value is one of the hash algorithm constants
118118
** corresponding to the hash that matched if the hash is correct.
119
-** (Examples: HNAME_SHA1 or HNAME_K224). And the return is HNAME_ERROR
119
+** (Examples: HNAME_SHA1 or HNAME_K256). And the return is HNAME_ERROR
120120
** if the hash does not match.
121121
*/
122122
int hname_verify_file_hash(const char *zFile, const char *zHash, int nHash){
123123
int id = HNAME_ERROR;
124124
switch( nHash ){
125125
--- src/hname.c
+++ src/hname.c
@@ -60,11 +60,11 @@
60 if( nHash==HNAME_LEN_K256 ) return "SHA3-256";
61 return "?";
62 }
63
64 /*
65 ** Return the integer hash algorithm code number (ex: HNAME_K224) for
66 ** the hash string provided. Or return HNAME_ERROR (0) if the input string
67 ** is not a valid artifact hash string.
68 */
69 int hname_validate(const char *zHash, int nHash){
70 int id;
@@ -82,11 +82,11 @@
82 ** Return true if the hash is correct. Return false if the content
83 ** does not match the hash.
84 **
85 ** Actually, the returned value is one of the hash algorithm constants
86 ** corresponding to the hash that matched if the hash is correct.
87 ** (Examples: HNAME_SHA1 or HNAME_K224). And the return is HNAME_ERROR
88 ** if the hash does not match.
89 */
90 int hname_verify_hash(Blob *pContent, const char *zHash, int nHash){
91 int id = HNAME_ERROR;
92 switch( nHash ){
@@ -114,11 +114,11 @@
114 ** Return true if the hash is correct. Return false if the content
115 ** does not match the hash.
116 **
117 ** Actually, the returned value is one of the hash algorithm constants
118 ** corresponding to the hash that matched if the hash is correct.
119 ** (Examples: HNAME_SHA1 or HNAME_K224). And the return is HNAME_ERROR
120 ** if the hash does not match.
121 */
122 int hname_verify_file_hash(const char *zFile, const char *zHash, int nHash){
123 int id = HNAME_ERROR;
124 switch( nHash ){
125
--- src/hname.c
+++ src/hname.c
@@ -60,11 +60,11 @@
60 if( nHash==HNAME_LEN_K256 ) return "SHA3-256";
61 return "?";
62 }
63
64 /*
65 ** Return the integer hash algorithm code number (ex: HNAME_K256) for
66 ** the hash string provided. Or return HNAME_ERROR (0) if the input string
67 ** is not a valid artifact hash string.
68 */
69 int hname_validate(const char *zHash, int nHash){
70 int id;
@@ -82,11 +82,11 @@
82 ** Return true if the hash is correct. Return false if the content
83 ** does not match the hash.
84 **
85 ** Actually, the returned value is one of the hash algorithm constants
86 ** corresponding to the hash that matched if the hash is correct.
87 ** (Examples: HNAME_SHA1 or HNAME_K256). And the return is HNAME_ERROR
88 ** if the hash does not match.
89 */
90 int hname_verify_hash(Blob *pContent, const char *zHash, int nHash){
91 int id = HNAME_ERROR;
92 switch( nHash ){
@@ -114,11 +114,11 @@
114 ** Return true if the hash is correct. Return false if the content
115 ** does not match the hash.
116 **
117 ** Actually, the returned value is one of the hash algorithm constants
118 ** corresponding to the hash that matched if the hash is correct.
119 ** (Examples: HNAME_SHA1 or HNAME_K256). And the return is HNAME_ERROR
120 ** if the hash does not match.
121 */
122 int hname_verify_file_hash(const char *zFile, const char *zHash, int nHash){
123 int id = HNAME_ERROR;
124 switch( nHash ){
125
+1 -1
--- src/manifest.c
+++ src/manifest.c
@@ -327,11 +327,11 @@
327327
** takes over the input blob and will free it when the
328328
** Manifest object is freed. Zeros are inserted into the blob
329329
** as string terminators so that blob should not be used again.
330330
**
331331
** Return a pointer to an allocated Manifest object if the content
332
-** really is a structural artifact of some kind. The returned Manifest
332
+** really is a structural artifact of some kind. The returned Manifest
333333
** object needs to be freed by a subsequent call to manifest_destroy().
334334
** Return NULL if there are syntax errors or if the input blob does
335335
** not describe a valid structural artifact.
336336
**
337337
** This routine is strict about the format of a structural artifacts.
338338
--- src/manifest.c
+++ src/manifest.c
@@ -327,11 +327,11 @@
327 ** takes over the input blob and will free it when the
328 ** Manifest object is freed. Zeros are inserted into the blob
329 ** as string terminators so that blob should not be used again.
330 **
331 ** Return a pointer to an allocated Manifest object if the content
332 ** really is a structural artifact of some kind. The returned Manifest
333 ** object needs to be freed by a subsequent call to manifest_destroy().
334 ** Return NULL if there are syntax errors or if the input blob does
335 ** not describe a valid structural artifact.
336 **
337 ** This routine is strict about the format of a structural artifacts.
338
--- src/manifest.c
+++ src/manifest.c
@@ -327,11 +327,11 @@
327 ** takes over the input blob and will free it when the
328 ** Manifest object is freed. Zeros are inserted into the blob
329 ** as string terminators so that blob should not be used again.
330 **
331 ** Return a pointer to an allocated Manifest object if the content
332 ** really is a structural artifact of some kind. The returned Manifest
333 ** object needs to be freed by a subsequent call to manifest_destroy().
334 ** Return NULL if there are syntax errors or if the input blob does
335 ** not describe a valid structural artifact.
336 **
337 ** This routine is strict about the format of a structural artifacts.
338
+3 -3
--- src/sha1.c
+++ src/sha1.c
@@ -54,20 +54,20 @@
5454
uint32_t m2[80];
5555
uint32_t states[80][5];
5656
};
5757
#endif
5858
void SHA1DCInit(SHA1_CTX*);
59
-void SHA1DCUpdate(SHA1_CTX*, const char*, unsigned);
59
+void SHA1DCUpdate(SHA1_CTX*, const unsigned char*, unsigned);
6060
int SHA1DCFinal(unsigned char[20], SHA1_CTX*);
6161
6262
#define SHA1Context SHA1_CTX
6363
#define SHA1Init SHA1DCInit
6464
#define SHA1Update SHA1DCUpdate
6565
#define SHA1Final SHA1DCFinal
6666
6767
/*
68
-** SHA1 Implemenatation #2: use the SHA1 algorithm built into SSL
68
+** SHA1 Implementation #2: use the SHA1 algorithm built into SSL
6969
*/
7070
#elif defined(FOSSIL_ENABLE_SSL)
7171
7272
# include <openssl/sha.h>
7373
# define SHA1Context SHA_CTX
@@ -74,11 +74,11 @@
7474
# define SHA1Init SHA1_Init
7575
# define SHA1Update SHA1_Update
7676
# define SHA1Final SHA1_Final
7777
7878
/*
79
-** SHA1 Implemenatation #3: If none of the previous two SHA1
79
+** SHA1 Implementation #3: If none of the previous two SHA1
8080
** algorithms work, there is this built-in. This built-in was the
8181
** original implementation used by Fossil.
8282
*/
8383
#else
8484
/*
8585
--- src/sha1.c
+++ src/sha1.c
@@ -54,20 +54,20 @@
54 uint32_t m2[80];
55 uint32_t states[80][5];
56 };
57 #endif
58 void SHA1DCInit(SHA1_CTX*);
59 void SHA1DCUpdate(SHA1_CTX*, const char*, unsigned);
60 int SHA1DCFinal(unsigned char[20], SHA1_CTX*);
61
62 #define SHA1Context SHA1_CTX
63 #define SHA1Init SHA1DCInit
64 #define SHA1Update SHA1DCUpdate
65 #define SHA1Final SHA1DCFinal
66
67 /*
68 ** SHA1 Implemenatation #2: use the SHA1 algorithm built into SSL
69 */
70 #elif defined(FOSSIL_ENABLE_SSL)
71
72 # include <openssl/sha.h>
73 # define SHA1Context SHA_CTX
@@ -74,11 +74,11 @@
74 # define SHA1Init SHA1_Init
75 # define SHA1Update SHA1_Update
76 # define SHA1Final SHA1_Final
77
78 /*
79 ** SHA1 Implemenatation #3: If none of the previous two SHA1
80 ** algorithms work, there is this built-in. This built-in was the
81 ** original implementation used by Fossil.
82 */
83 #else
84 /*
85
--- src/sha1.c
+++ src/sha1.c
@@ -54,20 +54,20 @@
54 uint32_t m2[80];
55 uint32_t states[80][5];
56 };
57 #endif
58 void SHA1DCInit(SHA1_CTX*);
59 void SHA1DCUpdate(SHA1_CTX*, const unsigned char*, unsigned);
60 int SHA1DCFinal(unsigned char[20], SHA1_CTX*);
61
62 #define SHA1Context SHA1_CTX
63 #define SHA1Init SHA1DCInit
64 #define SHA1Update SHA1DCUpdate
65 #define SHA1Final SHA1DCFinal
66
67 /*
68 ** SHA1 Implementation #2: use the SHA1 algorithm built into SSL
69 */
70 #elif defined(FOSSIL_ENABLE_SSL)
71
72 # include <openssl/sha.h>
73 # define SHA1Context SHA_CTX
@@ -74,11 +74,11 @@
74 # define SHA1Init SHA1_Init
75 # define SHA1Update SHA1_Update
76 # define SHA1Final SHA1_Final
77
78 /*
79 ** SHA1 Implementation #3: If none of the previous two SHA1
80 ** algorithms work, there is this built-in. This built-in was the
81 ** original implementation used by Fossil.
82 */
83 #else
84 /*
85
+8 -9
--- src/sha1hard.c
+++ src/sha1hard.c
@@ -1,8 +1,8 @@
11
/*
2
-** The code in this file is the concatination of several files
3
-** copied out of
2
+** The code in this file is the concatenation of several files
3
+** copied out of
44
**
55
** https://github.com/cr-marcstevens/sha1collisiondetection
66
**
77
** The copy was made on 2017-03-01. Some minor formatting changes
88
** were made but otherwise the code is unchanged. All
@@ -26,18 +26,18 @@
2626
* https://opensource.org/licenses/MIT
2727
***/
2828
/*************** File: LICENSE.txt ***************/
2929
/*
3030
** MIT License
31
-**
31
+**
3232
** Copyright (c) 2017:
3333
** Marc Stevens
3434
** Cryptology Group
3535
** Centrum Wiskunde & Informatica
3636
** P.O. Box 94079, 1090 GB Amsterdam, Netherlands
3737
** [email protected]
38
-**
38
+**
3939
** Dan Shumow
4040
** Microsoft Research
4141
** [email protected]
4242
**
4343
** Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -44,24 +44,23 @@
4444
** of this software and associated documentation files (the "Software"), to deal
4545
** in the Software without restriction, including without limitation the rights
4646
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
4747
** copies of the Software, and to permit persons to whom the Software is
4848
** furnished to do so, subject to the following conditions:
49
-**
49
+**
5050
** The above copyright notice and this permission notice shall be included in all
5151
** copies or substantial portions of the Software.
52
-**
52
+**
5353
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5454
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5555
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5656
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5757
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5858
** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
5959
** SOFTWARE.
6060
*/
6161
62
-#include "config.h"
6362
#include <string.h>
6463
#include <memory.h>
6564
#include <stdio.h>
6665
6766
#define DVMASKSIZE 1
@@ -1501,11 +1500,11 @@
15011500
void SHA1DCSetCallback(SHA1_CTX* ctx, collision_block_callback callback)
15021501
{
15031502
ctx->callback = callback;
15041503
}
15051504
1506
-void SHA1DCUpdate(SHA1_CTX* ctx, const char* buf, unsigned len)
1505
+void SHA1DCUpdate(SHA1_CTX* ctx, const unsigned char* buf, unsigned len)
15071506
{
15081507
unsigned left, fill;
15091508
if (len == 0)
15101509
return;
15111510
@@ -1555,11 +1554,11 @@
15551554
int SHA1DCFinal(unsigned char output[20], SHA1_CTX *ctx)
15561555
{
15571556
uint32_t last = ctx->total & 63;
15581557
uint32_t padn = (last < 56) ? (56 - last) : (120 - last);
15591558
uint64_t total;
1560
- SHA1DCUpdate(ctx, (const char*)(sha1_padding), padn);
1559
+ SHA1DCUpdate(ctx, sha1_padding, padn);
15611560
15621561
total = ctx->total - padn;
15631562
total <<= 3;
15641563
ctx->buffer[56] = (unsigned char)(total >> 56);
15651564
ctx->buffer[57] = (unsigned char)(total >> 48);
15661565
--- src/sha1hard.c
+++ src/sha1hard.c
@@ -1,8 +1,8 @@
1 /*
2 ** The code in this file is the concatination of several files
3 ** copied out of
4 **
5 ** https://github.com/cr-marcstevens/sha1collisiondetection
6 **
7 ** The copy was made on 2017-03-01. Some minor formatting changes
8 ** were made but otherwise the code is unchanged. All
@@ -26,18 +26,18 @@
26 * https://opensource.org/licenses/MIT
27 ***/
28 /*************** File: LICENSE.txt ***************/
29 /*
30 ** MIT License
31 **
32 ** Copyright (c) 2017:
33 ** Marc Stevens
34 ** Cryptology Group
35 ** Centrum Wiskunde & Informatica
36 ** P.O. Box 94079, 1090 GB Amsterdam, Netherlands
37 ** [email protected]
38 **
39 ** Dan Shumow
40 ** Microsoft Research
41 ** [email protected]
42 **
43 ** Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -44,24 +44,23 @@
44 ** of this software and associated documentation files (the "Software"), to deal
45 ** in the Software without restriction, including without limitation the rights
46 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
47 ** copies of the Software, and to permit persons to whom the Software is
48 ** furnished to do so, subject to the following conditions:
49 **
50 ** The above copyright notice and this permission notice shall be included in all
51 ** copies or substantial portions of the Software.
52 **
53 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55 ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56 ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57 ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58 ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59 ** SOFTWARE.
60 */
61
62 #include "config.h"
63 #include <string.h>
64 #include <memory.h>
65 #include <stdio.h>
66
67 #define DVMASKSIZE 1
@@ -1501,11 +1500,11 @@
1501 void SHA1DCSetCallback(SHA1_CTX* ctx, collision_block_callback callback)
1502 {
1503 ctx->callback = callback;
1504 }
1505
1506 void SHA1DCUpdate(SHA1_CTX* ctx, const char* buf, unsigned len)
1507 {
1508 unsigned left, fill;
1509 if (len == 0)
1510 return;
1511
@@ -1555,11 +1554,11 @@
1555 int SHA1DCFinal(unsigned char output[20], SHA1_CTX *ctx)
1556 {
1557 uint32_t last = ctx->total & 63;
1558 uint32_t padn = (last < 56) ? (56 - last) : (120 - last);
1559 uint64_t total;
1560 SHA1DCUpdate(ctx, (const char*)(sha1_padding), padn);
1561
1562 total = ctx->total - padn;
1563 total <<= 3;
1564 ctx->buffer[56] = (unsigned char)(total >> 56);
1565 ctx->buffer[57] = (unsigned char)(total >> 48);
1566
--- src/sha1hard.c
+++ src/sha1hard.c
@@ -1,8 +1,8 @@
1 /*
2 ** The code in this file is the concatenation of several files
3 ** copied out of
4 **
5 ** https://github.com/cr-marcstevens/sha1collisiondetection
6 **
7 ** The copy was made on 2017-03-01. Some minor formatting changes
8 ** were made but otherwise the code is unchanged. All
@@ -26,18 +26,18 @@
26 * https://opensource.org/licenses/MIT
27 ***/
28 /*************** File: LICENSE.txt ***************/
29 /*
30 ** MIT License
31 **
32 ** Copyright (c) 2017:
33 ** Marc Stevens
34 ** Cryptology Group
35 ** Centrum Wiskunde & Informatica
36 ** P.O. Box 94079, 1090 GB Amsterdam, Netherlands
37 ** [email protected]
38 **
39 ** Dan Shumow
40 ** Microsoft Research
41 ** [email protected]
42 **
43 ** Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -44,24 +44,23 @@
44 ** of this software and associated documentation files (the "Software"), to deal
45 ** in the Software without restriction, including without limitation the rights
46 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
47 ** copies of the Software, and to permit persons to whom the Software is
48 ** furnished to do so, subject to the following conditions:
49 **
50 ** The above copyright notice and this permission notice shall be included in all
51 ** copies or substantial portions of the Software.
52 **
53 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55 ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56 ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57 ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58 ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59 ** SOFTWARE.
60 */
61
 
62 #include <string.h>
63 #include <memory.h>
64 #include <stdio.h>
65
66 #define DVMASKSIZE 1
@@ -1501,11 +1500,11 @@
1500 void SHA1DCSetCallback(SHA1_CTX* ctx, collision_block_callback callback)
1501 {
1502 ctx->callback = callback;
1503 }
1504
1505 void SHA1DCUpdate(SHA1_CTX* ctx, const unsigned char* buf, unsigned len)
1506 {
1507 unsigned left, fill;
1508 if (len == 0)
1509 return;
1510
@@ -1555,11 +1554,11 @@
1554 int SHA1DCFinal(unsigned char output[20], SHA1_CTX *ctx)
1555 {
1556 uint32_t last = ctx->total & 63;
1557 uint32_t padn = (last < 56) ? (56 - last) : (120 - last);
1558 uint64_t total;
1559 SHA1DCUpdate(ctx, sha1_padding, padn);
1560
1561 total = ctx->total - padn;
1562 total <<= 3;
1563 ctx->buffer[56] = (unsigned char)(total >> 56);
1564 ctx->buffer[57] = (unsigned char)(total >> 48);
1565
+1 -1
--- src/sha3.c
+++ src/sha3.c
@@ -43,11 +43,11 @@
4343
#endif
4444
4545
4646
/*
4747
** State structure for a SHA3 hash in progress
48
-*/
48
+*/
4949
typedef struct SHA3Context SHA3Context;
5050
struct SHA3Context {
5151
union {
5252
u64 s[25]; /* Keccak state. 5x5 lines of 64 bits each */
5353
unsigned char x[1600]; /* ... or 1600 bytes */
5454
--- src/sha3.c
+++ src/sha3.c
@@ -43,11 +43,11 @@
43 #endif
44
45
46 /*
47 ** State structure for a SHA3 hash in progress
48 */
49 typedef struct SHA3Context SHA3Context;
50 struct SHA3Context {
51 union {
52 u64 s[25]; /* Keccak state. 5x5 lines of 64 bits each */
53 unsigned char x[1600]; /* ... or 1600 bytes */
54
--- src/sha3.c
+++ src/sha3.c
@@ -43,11 +43,11 @@
43 #endif
44
45
46 /*
47 ** State structure for a SHA3 hash in progress
48 */
49 typedef struct SHA3Context SHA3Context;
50 struct SHA3Context {
51 union {
52 u64 s[25]; /* Keccak state. 5x5 lines of 64 bits each */
53 unsigned char x[1600]; /* ... or 1600 bytes */
54
+4 -3
--- src/shell.c
+++ src/shell.c
@@ -2210,11 +2210,11 @@
22102210
" csv Comma-separated values\n"
22112211
" column Left-aligned columns. (See .width)\n"
22122212
" html HTML <table> code\n"
22132213
" insert SQL insert statements for TABLE\n"
22142214
" line One value per line\n"
2215
- " list Values delimited by .separator strings\n"
2215
+ " list Values delimited by \"|\"\n"
22162216
" quote Escape answers as for SQL\n"
22172217
" tabs Tab-separated values\n"
22182218
" tcl TCL list elements\n"
22192219
".nullvalue STRING Use STRING in place of NULL values\n"
22202220
".once FILENAME Output for the next SQL command only to FILENAME\n"
@@ -4342,10 +4342,11 @@
43424342
int newFlag = 0; /* True to delete file before opening */
43434343
/* Close the existing database */
43444344
session_close_all(p);
43454345
sqlite3_close(p->db);
43464346
p->db = 0;
4347
+ p->zDbFilename = 0;
43474348
sqlite3_free(p->zFreeOnClose);
43484349
p->zFreeOnClose = 0;
43494350
/* Check for command-line arguments */
43504351
for(iName=1; iName<nArg && azArg[iName][0]=='-'; iName++){
43514352
const char *z = azArg[iName];
@@ -4612,11 +4613,11 @@
46124613
}
46134614
}else
46144615
46154616
#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
46164617
if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
4617
- sqlite3SelectTrace = integerValue(azArg[1]);
4618
+ sqlite3SelectTrace = (int)integerValue(azArg[1]);
46184619
}else
46194620
#endif
46204621
46214622
#if defined(SQLITE_ENABLE_SESSION)
46224623
if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
@@ -5190,10 +5191,11 @@
51905191
azArg[1]);
51915192
break;
51925193
}
51935194
}
51945195
}else
5196
+#endif /* !defined(SQLITE_UNTESTABLE) */
51955197
51965198
if( c=='t' && n>4 && strncmp(azArg[0], "timeout", n)==0 ){
51975199
open_db(p, 0);
51985200
sqlite3_busy_timeout(p->db, nArg>=2 ? (int)integerValue(azArg[1]) : 0);
51995201
}else
@@ -5226,11 +5228,10 @@
52265228
}else{
52275229
sqlite3_trace_v2(p->db, SQLITE_TRACE_STMT, sql_trace_callback,p->traceOut);
52285230
}
52295231
#endif
52305232
}else
5231
-#endif /* !defined(SQLITE_UNTESTABLE) */
52325233
52335234
#if SQLITE_USER_AUTHENTICATION
52345235
if( c=='u' && strncmp(azArg[0], "user", n)==0 ){
52355236
if( nArg<2 ){
52365237
raw_printf(stderr, "Usage: .user SUBCOMMAND ...\n");
52375238
--- src/shell.c
+++ src/shell.c
@@ -2210,11 +2210,11 @@
2210 " csv Comma-separated values\n"
2211 " column Left-aligned columns. (See .width)\n"
2212 " html HTML <table> code\n"
2213 " insert SQL insert statements for TABLE\n"
2214 " line One value per line\n"
2215 " list Values delimited by .separator strings\n"
2216 " quote Escape answers as for SQL\n"
2217 " tabs Tab-separated values\n"
2218 " tcl TCL list elements\n"
2219 ".nullvalue STRING Use STRING in place of NULL values\n"
2220 ".once FILENAME Output for the next SQL command only to FILENAME\n"
@@ -4342,10 +4342,11 @@
4342 int newFlag = 0; /* True to delete file before opening */
4343 /* Close the existing database */
4344 session_close_all(p);
4345 sqlite3_close(p->db);
4346 p->db = 0;
 
4347 sqlite3_free(p->zFreeOnClose);
4348 p->zFreeOnClose = 0;
4349 /* Check for command-line arguments */
4350 for(iName=1; iName<nArg && azArg[iName][0]=='-'; iName++){
4351 const char *z = azArg[iName];
@@ -4612,11 +4613,11 @@
4612 }
4613 }else
4614
4615 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
4616 if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
4617 sqlite3SelectTrace = integerValue(azArg[1]);
4618 }else
4619 #endif
4620
4621 #if defined(SQLITE_ENABLE_SESSION)
4622 if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
@@ -5190,10 +5191,11 @@
5190 azArg[1]);
5191 break;
5192 }
5193 }
5194 }else
 
5195
5196 if( c=='t' && n>4 && strncmp(azArg[0], "timeout", n)==0 ){
5197 open_db(p, 0);
5198 sqlite3_busy_timeout(p->db, nArg>=2 ? (int)integerValue(azArg[1]) : 0);
5199 }else
@@ -5226,11 +5228,10 @@
5226 }else{
5227 sqlite3_trace_v2(p->db, SQLITE_TRACE_STMT, sql_trace_callback,p->traceOut);
5228 }
5229 #endif
5230 }else
5231 #endif /* !defined(SQLITE_UNTESTABLE) */
5232
5233 #if SQLITE_USER_AUTHENTICATION
5234 if( c=='u' && strncmp(azArg[0], "user", n)==0 ){
5235 if( nArg<2 ){
5236 raw_printf(stderr, "Usage: .user SUBCOMMAND ...\n");
5237
--- src/shell.c
+++ src/shell.c
@@ -2210,11 +2210,11 @@
2210 " csv Comma-separated values\n"
2211 " column Left-aligned columns. (See .width)\n"
2212 " html HTML <table> code\n"
2213 " insert SQL insert statements for TABLE\n"
2214 " line One value per line\n"
2215 " list Values delimited by \"|\"\n"
2216 " quote Escape answers as for SQL\n"
2217 " tabs Tab-separated values\n"
2218 " tcl TCL list elements\n"
2219 ".nullvalue STRING Use STRING in place of NULL values\n"
2220 ".once FILENAME Output for the next SQL command only to FILENAME\n"
@@ -4342,10 +4342,11 @@
4342 int newFlag = 0; /* True to delete file before opening */
4343 /* Close the existing database */
4344 session_close_all(p);
4345 sqlite3_close(p->db);
4346 p->db = 0;
4347 p->zDbFilename = 0;
4348 sqlite3_free(p->zFreeOnClose);
4349 p->zFreeOnClose = 0;
4350 /* Check for command-line arguments */
4351 for(iName=1; iName<nArg && azArg[iName][0]=='-'; iName++){
4352 const char *z = azArg[iName];
@@ -4612,11 +4613,11 @@
4613 }
4614 }else
4615
4616 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
4617 if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
4618 sqlite3SelectTrace = (int)integerValue(azArg[1]);
4619 }else
4620 #endif
4621
4622 #if defined(SQLITE_ENABLE_SESSION)
4623 if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
@@ -5190,10 +5191,11 @@
5191 azArg[1]);
5192 break;
5193 }
5194 }
5195 }else
5196 #endif /* !defined(SQLITE_UNTESTABLE) */
5197
5198 if( c=='t' && n>4 && strncmp(azArg[0], "timeout", n)==0 ){
5199 open_db(p, 0);
5200 sqlite3_busy_timeout(p->db, nArg>=2 ? (int)integerValue(azArg[1]) : 0);
5201 }else
@@ -5226,11 +5228,10 @@
5228 }else{
5229 sqlite3_trace_v2(p->db, SQLITE_TRACE_STMT, sql_trace_callback,p->traceOut);
5230 }
5231 #endif
5232 }else
 
5233
5234 #if SQLITE_USER_AUTHENTICATION
5235 if( c=='u' && strncmp(azArg[0], "user", n)==0 ){
5236 if( nArg<2 ){
5237 raw_printf(stderr, "Usage: .user SUBCOMMAND ...\n");
5238
+1 -1
--- src/shun.c
+++ src/shun.c
@@ -173,11 +173,11 @@
173173
@ 64-character lowercase hexadecimal hash of the artifact content) in the
174174
@ following box and press the "Shun" button. This will cause the artifacts
175175
@ to be removed from the repository and will prevent the artifacts from being
176176
@ readded to the repository by subsequent sync operation.</p>
177177
@
178
- @ <p>Note that you must enter the full 40- or 64-character artifact hashes,
178
+ @ <p>Note that you must enter the full 40- or 64-character artifact hashes,
179179
@ not an abbreviation or a symbolic tag.</p>
180180
@
181181
@ <p>Warning: Shunning should only be used to remove inappropriate content
182182
@ from the repository. Inappropriate content includes such things as
183183
@ spam added to Wiki, files that violate copyright or patent agreements,
184184
--- src/shun.c
+++ src/shun.c
@@ -173,11 +173,11 @@
173 @ 64-character lowercase hexadecimal hash of the artifact content) in the
174 @ following box and press the "Shun" button. This will cause the artifacts
175 @ to be removed from the repository and will prevent the artifacts from being
176 @ readded to the repository by subsequent sync operation.</p>
177 @
178 @ <p>Note that you must enter the full 40- or 64-character artifact hashes,
179 @ not an abbreviation or a symbolic tag.</p>
180 @
181 @ <p>Warning: Shunning should only be used to remove inappropriate content
182 @ from the repository. Inappropriate content includes such things as
183 @ spam added to Wiki, files that violate copyright or patent agreements,
184
--- src/shun.c
+++ src/shun.c
@@ -173,11 +173,11 @@
173 @ 64-character lowercase hexadecimal hash of the artifact content) in the
174 @ following box and press the "Shun" button. This will cause the artifacts
175 @ to be removed from the repository and will prevent the artifacts from being
176 @ readded to the repository by subsequent sync operation.</p>
177 @
178 @ <p>Note that you must enter the full 40- or 64-character artifact hashes,
179 @ not an abbreviation or a symbolic tag.</p>
180 @
181 @ <p>Warning: Shunning should only be used to remove inappropriate content
182 @ from the repository. Inappropriate content includes such things as
183 @ spam added to Wiki, files that violate copyright or patent agreements,
184
+35 -32
--- src/stash.c
+++ src/stash.c
@@ -332,52 +332,45 @@
332332
isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a);
333333
diff_file_mem(&empty, &a, isBin1, isBin2, zNew, zDiffCmd,
334334
zBinGlob, fIncludeBinary, diffFlags);
335335
}else if( isRemoved ){
336336
fossil_print("DELETE %s\n", zOrig);
337
- if( fBaseline==0 ){
338
- if( file_wd_islink(zOPath) ){
339
- blob_read_link(&a, zOPath);
340
- }else{
341
- blob_read_from_file(&a, zOPath);
342
- }
343
- }else{
344
- content_get(rid, &a);
345
- }
346
- diff_print_index(zNew, diffFlags);
347
- isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a);
348
- isBin2 = 0;
349
- diff_file_mem(&a, &empty, isBin1, isBin2, zOrig, zDiffCmd,
350
- zBinGlob, fIncludeBinary, diffFlags);
351
- }else{
352
- Blob delta, disk;
337
+ diff_print_index(zNew, diffFlags);
338
+ isBin2 = 0;
339
+ if( fBaseline ){
340
+ content_get(rid, &a);
341
+ isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a);
342
+ diff_file_mem(&a, &empty, isBin1, isBin2, zOrig, zDiffCmd,
343
+ zBinGlob, fIncludeBinary, diffFlags);
344
+ }else{
345
+ }
346
+ }else{
347
+ Blob delta;
353348
int isOrigLink = file_wd_islink(zOPath);
354349
db_ephemeral_blob(&q, 6, &delta);
355
- if( fBaseline==0 ){
356
- if( isOrigLink ){
357
- blob_read_link(&disk, zOPath);
358
- }else{
359
- blob_read_from_file(&disk, zOPath);
360
- }
361
- }
362350
fossil_print("CHANGED %s\n", zNew);
363351
if( !isOrigLink != !isLink ){
364352
diff_print_index(zNew, diffFlags);
365353
diff_print_filenames(zOrig, zNew, diffFlags);
366354
printf(DIFF_CANNOT_COMPUTE_SYMLINK);
367355
}else{
368
- Blob *pBase = fBaseline ? &a : &disk;
369356
content_get(rid, &a);
370357
blob_delta_apply(&a, &delta, &b);
371
- isBin1 = fIncludeBinary ? 0 : looks_like_binary(pBase);
358
+ isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a);
372359
isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b);
373
- diff_file_mem(fBaseline? &a : &disk, &b, isBin1, isBin2, zNew,
374
- zDiffCmd, zBinGlob, fIncludeBinary, diffFlags);
360
+ if( fBaseline ){
361
+ diff_file_mem(&a, &b, isBin1, isBin2, zNew,
362
+ zDiffCmd, zBinGlob, fIncludeBinary, diffFlags);
363
+ }else{
364
+ /*Diff with file on disk using fSwapDiff=1 to show the diff in the
365
+ same direction as if fBaseline=1.*/
366
+ diff_file(&b, isBin2, zOPath, zNew, zDiffCmd,
367
+ zBinGlob, fIncludeBinary, diffFlags, 1);
368
+ }
375369
blob_reset(&a);
376370
blob_reset(&b);
377371
}
378
- if( !fBaseline ) blob_reset(&disk);
379372
blob_reset(&delta);
380373
}
381374
}
382375
db_finalize(&q);
383376
}
@@ -433,12 +426,15 @@
433426
**
434427
** List all changes sets currently stashed. Show information about
435428
** individual files in each changeset if -v or --verbose is used.
436429
**
437430
** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
431
+** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
438432
**
439
-** Show the contents of a stash.
433
+** Show the contents of a stash as a diff against it's baseline.
434
+** With gshow and gcat, gdiff-command is used instead of internal
435
+** diff logic.
440436
**
441437
** fossil stash pop
442438
** fossil stash apply ?STASHID?
443439
**
444440
** Apply STASHID or the most recently create stash to the current
@@ -460,18 +456,20 @@
460456
**
461457
** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
462458
** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
463459
**
464460
** Show diffs of the current working directory and what that
465
-** directory would be if STASHID were applied.
461
+** directory would be if STASHID were applied. With gdiff,
462
+** gdiff-command is used instead of internal diff logic.
466463
**
467464
** SUMMARY:
468465
** fossil stash
469466
** fossil stash save ?-m|--comment COMMENT? ?FILES...?
470467
** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
471468
** fossil stash list|ls ?-v|--verbose? ?-W|--width <num>?
472469
** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
470
+** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
473471
** fossil stash pop
474472
** fossil stash apply|goto ?STASHID?
475473
** fossil stash drop|rm ?STASHID? ?-a|--all?
476474
** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
477475
** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
@@ -654,25 +652,30 @@
654652
undo_finish();
655653
}else
656654
if( memcmp(zCmd, "diff", nCmd)==0
657655
|| memcmp(zCmd, "gdiff", nCmd)==0
658656
|| memcmp(zCmd, "show", nCmd)==0
657
+ || memcmp(zCmd, "gshow", nCmd)==0
659658
|| memcmp(zCmd, "cat", nCmd)==0
659
+ || memcmp(zCmd, "gcat", nCmd)==0
660660
){
661661
const char *zDiffCmd = 0;
662662
const char *zBinGlob = 0;
663663
int fIncludeBinary = 0;
664
- int fBaseline = zCmd[0]=='s' || zCmd[0]=='c';
664
+ int fBaseline = 0;
665665
u64 diffFlags;
666666
667
+ if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){
668
+ fBaseline = 1;
669
+ }
667670
if( find_option("tk",0,0)!=0 ){
668671
db_close(0);
669672
diff_tk(fBaseline ? "stash show" : "stash diff", 3);
670673
return;
671674
}
672675
if( find_option("internal","i",0)==0 ){
673
- zDiffCmd = diff_command_external(memcmp(zCmd, "gdiff", nCmd)==0);
676
+ zDiffCmd = diff_command_external(zCmd[0]=='g');
674677
}
675678
diffFlags = diff_options();
676679
if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
677680
if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd));
678681
if( zDiffCmd ){
679682
--- src/stash.c
+++ src/stash.c
@@ -332,52 +332,45 @@
332 isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a);
333 diff_file_mem(&empty, &a, isBin1, isBin2, zNew, zDiffCmd,
334 zBinGlob, fIncludeBinary, diffFlags);
335 }else if( isRemoved ){
336 fossil_print("DELETE %s\n", zOrig);
337 if( fBaseline==0 ){
338 if( file_wd_islink(zOPath) ){
339 blob_read_link(&a, zOPath);
340 }else{
341 blob_read_from_file(&a, zOPath);
342 }
343 }else{
344 content_get(rid, &a);
345 }
346 diff_print_index(zNew, diffFlags);
347 isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a);
348 isBin2 = 0;
349 diff_file_mem(&a, &empty, isBin1, isBin2, zOrig, zDiffCmd,
350 zBinGlob, fIncludeBinary, diffFlags);
351 }else{
352 Blob delta, disk;
353 int isOrigLink = file_wd_islink(zOPath);
354 db_ephemeral_blob(&q, 6, &delta);
355 if( fBaseline==0 ){
356 if( isOrigLink ){
357 blob_read_link(&disk, zOPath);
358 }else{
359 blob_read_from_file(&disk, zOPath);
360 }
361 }
362 fossil_print("CHANGED %s\n", zNew);
363 if( !isOrigLink != !isLink ){
364 diff_print_index(zNew, diffFlags);
365 diff_print_filenames(zOrig, zNew, diffFlags);
366 printf(DIFF_CANNOT_COMPUTE_SYMLINK);
367 }else{
368 Blob *pBase = fBaseline ? &a : &disk;
369 content_get(rid, &a);
370 blob_delta_apply(&a, &delta, &b);
371 isBin1 = fIncludeBinary ? 0 : looks_like_binary(pBase);
372 isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b);
373 diff_file_mem(fBaseline? &a : &disk, &b, isBin1, isBin2, zNew,
374 zDiffCmd, zBinGlob, fIncludeBinary, diffFlags);
 
 
 
 
 
 
 
375 blob_reset(&a);
376 blob_reset(&b);
377 }
378 if( !fBaseline ) blob_reset(&disk);
379 blob_reset(&delta);
380 }
381 }
382 db_finalize(&q);
383 }
@@ -433,12 +426,15 @@
433 **
434 ** List all changes sets currently stashed. Show information about
435 ** individual files in each changeset if -v or --verbose is used.
436 **
437 ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
 
438 **
439 ** Show the contents of a stash.
 
 
440 **
441 ** fossil stash pop
442 ** fossil stash apply ?STASHID?
443 **
444 ** Apply STASHID or the most recently create stash to the current
@@ -460,18 +456,20 @@
460 **
461 ** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
462 ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
463 **
464 ** Show diffs of the current working directory and what that
465 ** directory would be if STASHID were applied.
 
466 **
467 ** SUMMARY:
468 ** fossil stash
469 ** fossil stash save ?-m|--comment COMMENT? ?FILES...?
470 ** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
471 ** fossil stash list|ls ?-v|--verbose? ?-W|--width <num>?
472 ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
 
473 ** fossil stash pop
474 ** fossil stash apply|goto ?STASHID?
475 ** fossil stash drop|rm ?STASHID? ?-a|--all?
476 ** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
477 ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
@@ -654,25 +652,30 @@
654 undo_finish();
655 }else
656 if( memcmp(zCmd, "diff", nCmd)==0
657 || memcmp(zCmd, "gdiff", nCmd)==0
658 || memcmp(zCmd, "show", nCmd)==0
 
659 || memcmp(zCmd, "cat", nCmd)==0
 
660 ){
661 const char *zDiffCmd = 0;
662 const char *zBinGlob = 0;
663 int fIncludeBinary = 0;
664 int fBaseline = zCmd[0]=='s' || zCmd[0]=='c';
665 u64 diffFlags;
666
 
 
 
667 if( find_option("tk",0,0)!=0 ){
668 db_close(0);
669 diff_tk(fBaseline ? "stash show" : "stash diff", 3);
670 return;
671 }
672 if( find_option("internal","i",0)==0 ){
673 zDiffCmd = diff_command_external(memcmp(zCmd, "gdiff", nCmd)==0);
674 }
675 diffFlags = diff_options();
676 if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
677 if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd));
678 if( zDiffCmd ){
679
--- src/stash.c
+++ src/stash.c
@@ -332,52 +332,45 @@
332 isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a);
333 diff_file_mem(&empty, &a, isBin1, isBin2, zNew, zDiffCmd,
334 zBinGlob, fIncludeBinary, diffFlags);
335 }else if( isRemoved ){
336 fossil_print("DELETE %s\n", zOrig);
337 diff_print_index(zNew, diffFlags);
338 isBin2 = 0;
339 if( fBaseline ){
340 content_get(rid, &a);
341 isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a);
342 diff_file_mem(&a, &empty, isBin1, isBin2, zOrig, zDiffCmd,
343 zBinGlob, fIncludeBinary, diffFlags);
344 }else{
345 }
346 }else{
347 Blob delta;
 
 
 
 
 
348 int isOrigLink = file_wd_islink(zOPath);
349 db_ephemeral_blob(&q, 6, &delta);
 
 
 
 
 
 
 
350 fossil_print("CHANGED %s\n", zNew);
351 if( !isOrigLink != !isLink ){
352 diff_print_index(zNew, diffFlags);
353 diff_print_filenames(zOrig, zNew, diffFlags);
354 printf(DIFF_CANNOT_COMPUTE_SYMLINK);
355 }else{
 
356 content_get(rid, &a);
357 blob_delta_apply(&a, &delta, &b);
358 isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a);
359 isBin2 = fIncludeBinary ? 0 : looks_like_binary(&b);
360 if( fBaseline ){
361 diff_file_mem(&a, &b, isBin1, isBin2, zNew,
362 zDiffCmd, zBinGlob, fIncludeBinary, diffFlags);
363 }else{
364 /*Diff with file on disk using fSwapDiff=1 to show the diff in the
365 same direction as if fBaseline=1.*/
366 diff_file(&b, isBin2, zOPath, zNew, zDiffCmd,
367 zBinGlob, fIncludeBinary, diffFlags, 1);
368 }
369 blob_reset(&a);
370 blob_reset(&b);
371 }
 
372 blob_reset(&delta);
373 }
374 }
375 db_finalize(&q);
376 }
@@ -433,12 +426,15 @@
426 **
427 ** List all changes sets currently stashed. Show information about
428 ** individual files in each changeset if -v or --verbose is used.
429 **
430 ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
431 ** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
432 **
433 ** Show the contents of a stash as a diff against it's baseline.
434 ** With gshow and gcat, gdiff-command is used instead of internal
435 ** diff logic.
436 **
437 ** fossil stash pop
438 ** fossil stash apply ?STASHID?
439 **
440 ** Apply STASHID or the most recently create stash to the current
@@ -460,18 +456,20 @@
456 **
457 ** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
458 ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
459 **
460 ** Show diffs of the current working directory and what that
461 ** directory would be if STASHID were applied. With gdiff,
462 ** gdiff-command is used instead of internal diff logic.
463 **
464 ** SUMMARY:
465 ** fossil stash
466 ** fossil stash save ?-m|--comment COMMENT? ?FILES...?
467 ** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
468 ** fossil stash list|ls ?-v|--verbose? ?-W|--width <num>?
469 ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS?
470 ** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS?
471 ** fossil stash pop
472 ** fossil stash apply|goto ?STASHID?
473 ** fossil stash drop|rm ?STASHID? ?-a|--all?
474 ** fossil stash diff ?STASHID? ?DIFF-OPTIONS?
475 ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS?
@@ -654,25 +652,30 @@
652 undo_finish();
653 }else
654 if( memcmp(zCmd, "diff", nCmd)==0
655 || memcmp(zCmd, "gdiff", nCmd)==0
656 || memcmp(zCmd, "show", nCmd)==0
657 || memcmp(zCmd, "gshow", nCmd)==0
658 || memcmp(zCmd, "cat", nCmd)==0
659 || memcmp(zCmd, "gcat", nCmd)==0
660 ){
661 const char *zDiffCmd = 0;
662 const char *zBinGlob = 0;
663 int fIncludeBinary = 0;
664 int fBaseline = 0;
665 u64 diffFlags;
666
667 if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){
668 fBaseline = 1;
669 }
670 if( find_option("tk",0,0)!=0 ){
671 db_close(0);
672 diff_tk(fBaseline ? "stash show" : "stash diff", 3);
673 return;
674 }
675 if( find_option("internal","i",0)==0 ){
676 zDiffCmd = diff_command_external(zCmd[0]=='g');
677 }
678 diffFlags = diff_options();
679 if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE;
680 if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd));
681 if( zDiffCmd ){
682
--- src/unversioned.c
+++ src/unversioned.c
@@ -456,11 +456,11 @@
456456
** Query parameters:
457457
**
458458
** byage=1 Order the initial display be decreasing age
459459
** showdel=0 Show deleted files
460460
*/
461
-void uvstat_page(void){
461
+void uvlist_page(void){
462462
Stmt q;
463463
sqlite3_int64 iNow;
464464
sqlite3_int64 iTotalSz = 0;
465465
int cnt = 0;
466466
int n = 0;
@@ -554,5 +554,62 @@
554554
}else{
555555
@ No unversioned files on this server.
556556
}
557557
style_footer();
558558
}
559
+
560
+/*
561
+** WEBPAGE: juvlist
562
+**
563
+** Return a complete list of unversioned files as JSON. The JSON
564
+** looks like this:
565
+**
566
+** [{"name":NAME,
567
+** "mtime":MTIME,
568
+** "hash":HASH,
569
+** "size":SIZE,
570
+* "user":USER}]
571
+*/
572
+void uvlist_json_page(void){
573
+ Stmt q;
574
+ char *zSep = "[";
575
+ Blob json;
576
+
577
+ login_check_credentials();
578
+ if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
579
+ cgi_set_content_type("text/json");
580
+ if( !db_table_exists("repository","unversioned") ){
581
+ blob_init(&json, "[]", -1);
582
+ cgi_set_content(&json);
583
+ return;
584
+ }
585
+ blob_init(&json, 0, 0);
586
+ db_prepare(&q,
587
+ "SELECT"
588
+ " name,"
589
+ " mtime,"
590
+ " hash,"
591
+ " sz,"
592
+ " (SELECT login FROM rcvfrom, user"
593
+ " WHERE user.uid=rcvfrom.uid AND rcvfrom.rcvid=unversioned.rcvid)"
594
+ " FROM unversioned WHERE hash IS NOT NULL"
595
+ );
596
+ while( db_step(&q)==SQLITE_ROW ){
597
+ const char *zName = db_column_text(&q, 0);
598
+ sqlite3_int64 mtime = db_column_int(&q, 1);
599
+ const char *zHash = db_column_text(&q, 2);
600
+ int fullSize = db_column_int(&q, 3);
601
+ const char *zLogin = db_column_text(&q, 4);
602
+ if( zLogin==0 ) zLogin = "";
603
+ blob_appendf(&json, "%s{\"name\":\"", zSep);
604
+ zSep = ",\n ";
605
+ blob_append_json_string(&json, zName);
606
+ blob_appendf(&json, "\",\n \"mtime\":%lld,\n \"hash\":\"", mtime);
607
+ blob_append_json_string(&json, zHash);
608
+ blob_appendf(&json, "\",\n \"size\":%d,\n \"user\":\"", fullSize);
609
+ blob_append_json_string(&json, zLogin);
610
+ blob_appendf(&json, "\"}");
611
+ }
612
+ db_finalize(&q);
613
+ blob_appendf(&json,"]\n");
614
+ cgi_set_content(&json);
615
+}
559616
--- src/unversioned.c
+++ src/unversioned.c
@@ -456,11 +456,11 @@
456 ** Query parameters:
457 **
458 ** byage=1 Order the initial display be decreasing age
459 ** showdel=0 Show deleted files
460 */
461 void uvstat_page(void){
462 Stmt q;
463 sqlite3_int64 iNow;
464 sqlite3_int64 iTotalSz = 0;
465 int cnt = 0;
466 int n = 0;
@@ -554,5 +554,62 @@
554 }else{
555 @ No unversioned files on this server.
556 }
557 style_footer();
558 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
559
--- src/unversioned.c
+++ src/unversioned.c
@@ -456,11 +456,11 @@
456 ** Query parameters:
457 **
458 ** byage=1 Order the initial display be decreasing age
459 ** showdel=0 Show deleted files
460 */
461 void uvlist_page(void){
462 Stmt q;
463 sqlite3_int64 iNow;
464 sqlite3_int64 iTotalSz = 0;
465 int cnt = 0;
466 int n = 0;
@@ -554,5 +554,62 @@
554 }else{
555 @ No unversioned files on this server.
556 }
557 style_footer();
558 }
559
560 /*
561 ** WEBPAGE: juvlist
562 **
563 ** Return a complete list of unversioned files as JSON. The JSON
564 ** looks like this:
565 **
566 ** [{"name":NAME,
567 ** "mtime":MTIME,
568 ** "hash":HASH,
569 ** "size":SIZE,
570 * "user":USER}]
571 */
572 void uvlist_json_page(void){
573 Stmt q;
574 char *zSep = "[";
575 Blob json;
576
577 login_check_credentials();
578 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
579 cgi_set_content_type("text/json");
580 if( !db_table_exists("repository","unversioned") ){
581 blob_init(&json, "[]", -1);
582 cgi_set_content(&json);
583 return;
584 }
585 blob_init(&json, 0, 0);
586 db_prepare(&q,
587 "SELECT"
588 " name,"
589 " mtime,"
590 " hash,"
591 " sz,"
592 " (SELECT login FROM rcvfrom, user"
593 " WHERE user.uid=rcvfrom.uid AND rcvfrom.rcvid=unversioned.rcvid)"
594 " FROM unversioned WHERE hash IS NOT NULL"
595 );
596 while( db_step(&q)==SQLITE_ROW ){
597 const char *zName = db_column_text(&q, 0);
598 sqlite3_int64 mtime = db_column_int(&q, 1);
599 const char *zHash = db_column_text(&q, 2);
600 int fullSize = db_column_int(&q, 3);
601 const char *zLogin = db_column_text(&q, 4);
602 if( zLogin==0 ) zLogin = "";
603 blob_appendf(&json, "%s{\"name\":\"", zSep);
604 zSep = ",\n ";
605 blob_append_json_string(&json, zName);
606 blob_appendf(&json, "\",\n \"mtime\":%lld,\n \"hash\":\"", mtime);
607 blob_append_json_string(&json, zHash);
608 blob_appendf(&json, "\",\n \"size\":%d,\n \"user\":\"", fullSize);
609 blob_append_json_string(&json, zLogin);
610 blob_appendf(&json, "\"}");
611 }
612 db_finalize(&q);
613 blob_appendf(&json,"]\n");
614 cgi_set_content(&json);
615 }
616
+1 -1
--- src/vfile.c
+++ src/vfile.c
@@ -21,11 +21,11 @@
2121
#include "vfile.h"
2222
#include <assert.h>
2323
#include <sys/types.h>
2424
2525
/*
26
-** The input is guaranteed to be a 40- or 64-character well-formed
26
+** The input is guaranteed to be a 40- or 64-character well-formed
2727
** artifact hash. Find its rid.
2828
*/
2929
int fast_uuid_to_rid(const char *zUuid){
3030
static Stmt q;
3131
int rid;
3232
--- src/vfile.c
+++ src/vfile.c
@@ -21,11 +21,11 @@
21 #include "vfile.h"
22 #include <assert.h>
23 #include <sys/types.h>
24
25 /*
26 ** The input is guaranteed to be a 40- or 64-character well-formed
27 ** artifact hash. Find its rid.
28 */
29 int fast_uuid_to_rid(const char *zUuid){
30 static Stmt q;
31 int rid;
32
--- src/vfile.c
+++ src/vfile.c
@@ -21,11 +21,11 @@
21 #include "vfile.h"
22 #include <assert.h>
23 #include <sys/types.h>
24
25 /*
26 ** The input is guaranteed to be a 40- or 64-character well-formed
27 ** artifact hash. Find its rid.
28 */
29 int fast_uuid_to_rid(const char *zUuid){
30 static Stmt q;
31 int rid;
32
+4 -3
--- src/xfer.c
+++ src/xfer.c
@@ -496,15 +496,15 @@
496496
}
497497
return size;
498498
}
499499
500500
/*
501
-** Push an error message to alert the older client that the repository
501
+** Push an error message to alert the older client that the repository
502502
** has SHA3 content and cannot be synced or cloned.
503503
*/
504504
static void xfer_cannot_send_sha3_error(Xfer *pXfer){
505
- blob_appendf(pXfer->pOut,
505
+ blob_appendf(pXfer->pOut,
506506
"error Fossil\\sversion\\s2.0\\sor\\slater\\srequired.\n"
507507
);
508508
}
509509
510510
@@ -750,11 +750,11 @@
750750
751751
/*
752752
** Compute an hash on the tail of pMsg. Verify that it matches the
753753
** the hash given in pHash. Return non-zero for an error and 0 on success.
754754
**
755
-** The type of hash computed (SHA1, SHA3-224, SHA3-256) is determined by
755
+** The type of hash computed (SHA1, SHA3-256) is determined by
756756
** the length of the input hash in pHash.
757757
*/
758758
static int check_tail_hash(Blob *pHash, Blob *pMsg){
759759
Blob tail;
760760
int rc;
@@ -1768,10 +1768,11 @@
17681768
memset(&xfer, 0, sizeof(xfer));
17691769
xfer.pIn = &recv;
17701770
xfer.pOut = &send;
17711771
xfer.mxSend = db_get_int("max-upload", 250000);
17721772
xfer.maxTime = -1;
1773
+ xfer.clientVersion = RELEASE_VERSION_NUMBER;
17731774
if( syncFlags & SYNC_PRIVATE ){
17741775
g.perm.Private = 1;
17751776
xfer.syncPrivate = 1;
17761777
}
17771778
17781779
--- src/xfer.c
+++ src/xfer.c
@@ -496,15 +496,15 @@
496 }
497 return size;
498 }
499
500 /*
501 ** Push an error message to alert the older client that the repository
502 ** has SHA3 content and cannot be synced or cloned.
503 */
504 static void xfer_cannot_send_sha3_error(Xfer *pXfer){
505 blob_appendf(pXfer->pOut,
506 "error Fossil\\sversion\\s2.0\\sor\\slater\\srequired.\n"
507 );
508 }
509
510
@@ -750,11 +750,11 @@
750
751 /*
752 ** Compute an hash on the tail of pMsg. Verify that it matches the
753 ** the hash given in pHash. Return non-zero for an error and 0 on success.
754 **
755 ** The type of hash computed (SHA1, SHA3-224, SHA3-256) is determined by
756 ** the length of the input hash in pHash.
757 */
758 static int check_tail_hash(Blob *pHash, Blob *pMsg){
759 Blob tail;
760 int rc;
@@ -1768,10 +1768,11 @@
1768 memset(&xfer, 0, sizeof(xfer));
1769 xfer.pIn = &recv;
1770 xfer.pOut = &send;
1771 xfer.mxSend = db_get_int("max-upload", 250000);
1772 xfer.maxTime = -1;
 
1773 if( syncFlags & SYNC_PRIVATE ){
1774 g.perm.Private = 1;
1775 xfer.syncPrivate = 1;
1776 }
1777
1778
--- src/xfer.c
+++ src/xfer.c
@@ -496,15 +496,15 @@
496 }
497 return size;
498 }
499
500 /*
501 ** Push an error message to alert the older client that the repository
502 ** has SHA3 content and cannot be synced or cloned.
503 */
504 static void xfer_cannot_send_sha3_error(Xfer *pXfer){
505 blob_appendf(pXfer->pOut,
506 "error Fossil\\sversion\\s2.0\\sor\\slater\\srequired.\n"
507 );
508 }
509
510
@@ -750,11 +750,11 @@
750
751 /*
752 ** Compute an hash on the tail of pMsg. Verify that it matches the
753 ** the hash given in pHash. Return non-zero for an error and 0 on success.
754 **
755 ** The type of hash computed (SHA1, SHA3-256) is determined by
756 ** the length of the input hash in pHash.
757 */
758 static int check_tail_hash(Blob *pHash, Blob *pMsg){
759 Blob tail;
760 int rc;
@@ -1768,10 +1768,11 @@
1768 memset(&xfer, 0, sizeof(xfer));
1769 xfer.pIn = &recv;
1770 xfer.pOut = &send;
1771 xfer.mxSend = db_get_int("max-upload", 250000);
1772 xfer.maxTime = -1;
1773 xfer.clientVersion = RELEASE_VERSION_NUMBER;
1774 if( syncFlags & SYNC_PRIVATE ){
1775 g.perm.Private = 1;
1776 xfer.syncPrivate = 1;
1777 }
1778
1779
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -461,10 +461,11 @@
461461
$(SRCDIR)/fshell.c \
462462
$(SRCDIR)/fusefs.c \
463463
$(SRCDIR)/glob.c \
464464
$(SRCDIR)/graph.c \
465465
$(SRCDIR)/gzip.c \
466
+ $(SRCDIR)/hname.c \
466467
$(SRCDIR)/http.c \
467468
$(SRCDIR)/http_socket.c \
468469
$(SRCDIR)/http_ssl.c \
469470
$(SRCDIR)/http_transport.c \
470471
$(SRCDIR)/import.c \
@@ -511,10 +512,12 @@
511512
$(SRCDIR)/rss.c \
512513
$(SRCDIR)/schema.c \
513514
$(SRCDIR)/search.c \
514515
$(SRCDIR)/setup.c \
515516
$(SRCDIR)/sha1.c \
517
+ $(SRCDIR)/sha1hard.c \
518
+ $(SRCDIR)/sha3.c \
516519
$(SRCDIR)/shun.c \
517520
$(SRCDIR)/sitemap.c \
518521
$(SRCDIR)/skins.c \
519522
$(SRCDIR)/sqlcmd.c \
520523
$(SRCDIR)/stash.c \
@@ -636,10 +639,11 @@
636639
$(OBJDIR)/fshell_.c \
637640
$(OBJDIR)/fusefs_.c \
638641
$(OBJDIR)/glob_.c \
639642
$(OBJDIR)/graph_.c \
640643
$(OBJDIR)/gzip_.c \
644
+ $(OBJDIR)/hname_.c \
641645
$(OBJDIR)/http_.c \
642646
$(OBJDIR)/http_socket_.c \
643647
$(OBJDIR)/http_ssl_.c \
644648
$(OBJDIR)/http_transport_.c \
645649
$(OBJDIR)/import_.c \
@@ -686,10 +690,12 @@
686690
$(OBJDIR)/rss_.c \
687691
$(OBJDIR)/schema_.c \
688692
$(OBJDIR)/search_.c \
689693
$(OBJDIR)/setup_.c \
690694
$(OBJDIR)/sha1_.c \
695
+ $(OBJDIR)/sha1hard_.c \
696
+ $(OBJDIR)/sha3_.c \
691697
$(OBJDIR)/shun_.c \
692698
$(OBJDIR)/sitemap_.c \
693699
$(OBJDIR)/skins_.c \
694700
$(OBJDIR)/sqlcmd_.c \
695701
$(OBJDIR)/stash_.c \
@@ -760,10 +766,11 @@
760766
$(OBJDIR)/fshell.o \
761767
$(OBJDIR)/fusefs.o \
762768
$(OBJDIR)/glob.o \
763769
$(OBJDIR)/graph.o \
764770
$(OBJDIR)/gzip.o \
771
+ $(OBJDIR)/hname.o \
765772
$(OBJDIR)/http.o \
766773
$(OBJDIR)/http_socket.o \
767774
$(OBJDIR)/http_ssl.o \
768775
$(OBJDIR)/http_transport.o \
769776
$(OBJDIR)/import.o \
@@ -810,10 +817,12 @@
810817
$(OBJDIR)/rss.o \
811818
$(OBJDIR)/schema.o \
812819
$(OBJDIR)/search.o \
813820
$(OBJDIR)/setup.o \
814821
$(OBJDIR)/sha1.o \
822
+ $(OBJDIR)/sha1hard.o \
823
+ $(OBJDIR)/sha3.o \
815824
$(OBJDIR)/shun.o \
816825
$(OBJDIR)/sitemap.o \
817826
$(OBJDIR)/skins.o \
818827
$(OBJDIR)/sqlcmd.o \
819828
$(OBJDIR)/stash.o \
@@ -1095,10 +1104,11 @@
10951104
$(OBJDIR)/fshell_.c:$(OBJDIR)/fshell.h \
10961105
$(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \
10971106
$(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
10981107
$(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
10991108
$(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
1109
+ $(OBJDIR)/hname_.c:$(OBJDIR)/hname.h \
11001110
$(OBJDIR)/http_.c:$(OBJDIR)/http.h \
11011111
$(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
11021112
$(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h \
11031113
$(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h \
11041114
$(OBJDIR)/import_.c:$(OBJDIR)/import.h \
@@ -1145,10 +1155,12 @@
11451155
$(OBJDIR)/rss_.c:$(OBJDIR)/rss.h \
11461156
$(OBJDIR)/schema_.c:$(OBJDIR)/schema.h \
11471157
$(OBJDIR)/search_.c:$(OBJDIR)/search.h \
11481158
$(OBJDIR)/setup_.c:$(OBJDIR)/setup.h \
11491159
$(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h \
1160
+ $(OBJDIR)/sha1hard_.c:$(OBJDIR)/sha1hard.h \
1161
+ $(OBJDIR)/sha3_.c:$(OBJDIR)/sha3.h \
11501162
$(OBJDIR)/shun_.c:$(OBJDIR)/shun.h \
11511163
$(OBJDIR)/sitemap_.c:$(OBJDIR)/sitemap.h \
11521164
$(OBJDIR)/skins_.c:$(OBJDIR)/skins.h \
11531165
$(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h \
11541166
$(OBJDIR)/stash_.c:$(OBJDIR)/stash.h \
@@ -1498,10 +1510,18 @@
14981510
14991511
$(OBJDIR)/gzip.o: $(OBJDIR)/gzip_.c $(OBJDIR)/gzip.h $(SRCDIR)/config.h
15001512
$(XTCC) -o $(OBJDIR)/gzip.o -c $(OBJDIR)/gzip_.c
15011513
15021514
$(OBJDIR)/gzip.h: $(OBJDIR)/headers
1515
+
1516
+$(OBJDIR)/hname_.c: $(SRCDIR)/hname.c $(TRANSLATE)
1517
+ $(TRANSLATE) $(SRCDIR)/hname.c >$@
1518
+
1519
+$(OBJDIR)/hname.o: $(OBJDIR)/hname_.c $(OBJDIR)/hname.h $(SRCDIR)/config.h
1520
+ $(XTCC) -o $(OBJDIR)/hname.o -c $(OBJDIR)/hname_.c
1521
+
1522
+$(OBJDIR)/hname.h: $(OBJDIR)/headers
15031523
15041524
$(OBJDIR)/http_.c: $(SRCDIR)/http.c $(TRANSLATE)
15051525
$(TRANSLATE) $(SRCDIR)/http.c >$@
15061526
15071527
$(OBJDIR)/http.o: $(OBJDIR)/http_.c $(OBJDIR)/http.h $(SRCDIR)/config.h
@@ -1898,10 +1918,26 @@
18981918
18991919
$(OBJDIR)/sha1.o: $(OBJDIR)/sha1_.c $(OBJDIR)/sha1.h $(SRCDIR)/config.h
19001920
$(XTCC) -o $(OBJDIR)/sha1.o -c $(OBJDIR)/sha1_.c
19011921
19021922
$(OBJDIR)/sha1.h: $(OBJDIR)/headers
1923
+
1924
+$(OBJDIR)/sha1hard_.c: $(SRCDIR)/sha1hard.c $(TRANSLATE)
1925
+ $(TRANSLATE) $(SRCDIR)/sha1hard.c >$@
1926
+
1927
+$(OBJDIR)/sha1hard.o: $(OBJDIR)/sha1hard_.c $(OBJDIR)/sha1hard.h $(SRCDIR)/config.h
1928
+ $(XTCC) -o $(OBJDIR)/sha1hard.o -c $(OBJDIR)/sha1hard_.c
1929
+
1930
+$(OBJDIR)/sha1hard.h: $(OBJDIR)/headers
1931
+
1932
+$(OBJDIR)/sha3_.c: $(SRCDIR)/sha3.c $(TRANSLATE)
1933
+ $(TRANSLATE) $(SRCDIR)/sha3.c >$@
1934
+
1935
+$(OBJDIR)/sha3.o: $(OBJDIR)/sha3_.c $(OBJDIR)/sha3.h $(SRCDIR)/config.h
1936
+ $(XTCC) -o $(OBJDIR)/sha3.o -c $(OBJDIR)/sha3_.c
1937
+
1938
+$(OBJDIR)/sha3.h: $(OBJDIR)/headers
19031939
19041940
$(OBJDIR)/shun_.c: $(SRCDIR)/shun.c $(TRANSLATE)
19051941
$(TRANSLATE) $(SRCDIR)/shun.c >$@
19061942
19071943
$(OBJDIR)/shun.o: $(OBJDIR)/shun_.c $(OBJDIR)/shun.h $(SRCDIR)/config.h
19081944
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -461,10 +461,11 @@
461 $(SRCDIR)/fshell.c \
462 $(SRCDIR)/fusefs.c \
463 $(SRCDIR)/glob.c \
464 $(SRCDIR)/graph.c \
465 $(SRCDIR)/gzip.c \
 
466 $(SRCDIR)/http.c \
467 $(SRCDIR)/http_socket.c \
468 $(SRCDIR)/http_ssl.c \
469 $(SRCDIR)/http_transport.c \
470 $(SRCDIR)/import.c \
@@ -511,10 +512,12 @@
511 $(SRCDIR)/rss.c \
512 $(SRCDIR)/schema.c \
513 $(SRCDIR)/search.c \
514 $(SRCDIR)/setup.c \
515 $(SRCDIR)/sha1.c \
 
 
516 $(SRCDIR)/shun.c \
517 $(SRCDIR)/sitemap.c \
518 $(SRCDIR)/skins.c \
519 $(SRCDIR)/sqlcmd.c \
520 $(SRCDIR)/stash.c \
@@ -636,10 +639,11 @@
636 $(OBJDIR)/fshell_.c \
637 $(OBJDIR)/fusefs_.c \
638 $(OBJDIR)/glob_.c \
639 $(OBJDIR)/graph_.c \
640 $(OBJDIR)/gzip_.c \
 
641 $(OBJDIR)/http_.c \
642 $(OBJDIR)/http_socket_.c \
643 $(OBJDIR)/http_ssl_.c \
644 $(OBJDIR)/http_transport_.c \
645 $(OBJDIR)/import_.c \
@@ -686,10 +690,12 @@
686 $(OBJDIR)/rss_.c \
687 $(OBJDIR)/schema_.c \
688 $(OBJDIR)/search_.c \
689 $(OBJDIR)/setup_.c \
690 $(OBJDIR)/sha1_.c \
 
 
691 $(OBJDIR)/shun_.c \
692 $(OBJDIR)/sitemap_.c \
693 $(OBJDIR)/skins_.c \
694 $(OBJDIR)/sqlcmd_.c \
695 $(OBJDIR)/stash_.c \
@@ -760,10 +766,11 @@
760 $(OBJDIR)/fshell.o \
761 $(OBJDIR)/fusefs.o \
762 $(OBJDIR)/glob.o \
763 $(OBJDIR)/graph.o \
764 $(OBJDIR)/gzip.o \
 
765 $(OBJDIR)/http.o \
766 $(OBJDIR)/http_socket.o \
767 $(OBJDIR)/http_ssl.o \
768 $(OBJDIR)/http_transport.o \
769 $(OBJDIR)/import.o \
@@ -810,10 +817,12 @@
810 $(OBJDIR)/rss.o \
811 $(OBJDIR)/schema.o \
812 $(OBJDIR)/search.o \
813 $(OBJDIR)/setup.o \
814 $(OBJDIR)/sha1.o \
 
 
815 $(OBJDIR)/shun.o \
816 $(OBJDIR)/sitemap.o \
817 $(OBJDIR)/skins.o \
818 $(OBJDIR)/sqlcmd.o \
819 $(OBJDIR)/stash.o \
@@ -1095,10 +1104,11 @@
1095 $(OBJDIR)/fshell_.c:$(OBJDIR)/fshell.h \
1096 $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \
1097 $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
1098 $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
1099 $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
 
1100 $(OBJDIR)/http_.c:$(OBJDIR)/http.h \
1101 $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
1102 $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h \
1103 $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h \
1104 $(OBJDIR)/import_.c:$(OBJDIR)/import.h \
@@ -1145,10 +1155,12 @@
1145 $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h \
1146 $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h \
1147 $(OBJDIR)/search_.c:$(OBJDIR)/search.h \
1148 $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h \
1149 $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h \
 
 
1150 $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h \
1151 $(OBJDIR)/sitemap_.c:$(OBJDIR)/sitemap.h \
1152 $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h \
1153 $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h \
1154 $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h \
@@ -1498,10 +1510,18 @@
1498
1499 $(OBJDIR)/gzip.o: $(OBJDIR)/gzip_.c $(OBJDIR)/gzip.h $(SRCDIR)/config.h
1500 $(XTCC) -o $(OBJDIR)/gzip.o -c $(OBJDIR)/gzip_.c
1501
1502 $(OBJDIR)/gzip.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
1503
1504 $(OBJDIR)/http_.c: $(SRCDIR)/http.c $(TRANSLATE)
1505 $(TRANSLATE) $(SRCDIR)/http.c >$@
1506
1507 $(OBJDIR)/http.o: $(OBJDIR)/http_.c $(OBJDIR)/http.h $(SRCDIR)/config.h
@@ -1898,10 +1918,26 @@
1898
1899 $(OBJDIR)/sha1.o: $(OBJDIR)/sha1_.c $(OBJDIR)/sha1.h $(SRCDIR)/config.h
1900 $(XTCC) -o $(OBJDIR)/sha1.o -c $(OBJDIR)/sha1_.c
1901
1902 $(OBJDIR)/sha1.h: $(OBJDIR)/headers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1903
1904 $(OBJDIR)/shun_.c: $(SRCDIR)/shun.c $(TRANSLATE)
1905 $(TRANSLATE) $(SRCDIR)/shun.c >$@
1906
1907 $(OBJDIR)/shun.o: $(OBJDIR)/shun_.c $(OBJDIR)/shun.h $(SRCDIR)/config.h
1908
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -461,10 +461,11 @@
461 $(SRCDIR)/fshell.c \
462 $(SRCDIR)/fusefs.c \
463 $(SRCDIR)/glob.c \
464 $(SRCDIR)/graph.c \
465 $(SRCDIR)/gzip.c \
466 $(SRCDIR)/hname.c \
467 $(SRCDIR)/http.c \
468 $(SRCDIR)/http_socket.c \
469 $(SRCDIR)/http_ssl.c \
470 $(SRCDIR)/http_transport.c \
471 $(SRCDIR)/import.c \
@@ -511,10 +512,12 @@
512 $(SRCDIR)/rss.c \
513 $(SRCDIR)/schema.c \
514 $(SRCDIR)/search.c \
515 $(SRCDIR)/setup.c \
516 $(SRCDIR)/sha1.c \
517 $(SRCDIR)/sha1hard.c \
518 $(SRCDIR)/sha3.c \
519 $(SRCDIR)/shun.c \
520 $(SRCDIR)/sitemap.c \
521 $(SRCDIR)/skins.c \
522 $(SRCDIR)/sqlcmd.c \
523 $(SRCDIR)/stash.c \
@@ -636,10 +639,11 @@
639 $(OBJDIR)/fshell_.c \
640 $(OBJDIR)/fusefs_.c \
641 $(OBJDIR)/glob_.c \
642 $(OBJDIR)/graph_.c \
643 $(OBJDIR)/gzip_.c \
644 $(OBJDIR)/hname_.c \
645 $(OBJDIR)/http_.c \
646 $(OBJDIR)/http_socket_.c \
647 $(OBJDIR)/http_ssl_.c \
648 $(OBJDIR)/http_transport_.c \
649 $(OBJDIR)/import_.c \
@@ -686,10 +690,12 @@
690 $(OBJDIR)/rss_.c \
691 $(OBJDIR)/schema_.c \
692 $(OBJDIR)/search_.c \
693 $(OBJDIR)/setup_.c \
694 $(OBJDIR)/sha1_.c \
695 $(OBJDIR)/sha1hard_.c \
696 $(OBJDIR)/sha3_.c \
697 $(OBJDIR)/shun_.c \
698 $(OBJDIR)/sitemap_.c \
699 $(OBJDIR)/skins_.c \
700 $(OBJDIR)/sqlcmd_.c \
701 $(OBJDIR)/stash_.c \
@@ -760,10 +766,11 @@
766 $(OBJDIR)/fshell.o \
767 $(OBJDIR)/fusefs.o \
768 $(OBJDIR)/glob.o \
769 $(OBJDIR)/graph.o \
770 $(OBJDIR)/gzip.o \
771 $(OBJDIR)/hname.o \
772 $(OBJDIR)/http.o \
773 $(OBJDIR)/http_socket.o \
774 $(OBJDIR)/http_ssl.o \
775 $(OBJDIR)/http_transport.o \
776 $(OBJDIR)/import.o \
@@ -810,10 +817,12 @@
817 $(OBJDIR)/rss.o \
818 $(OBJDIR)/schema.o \
819 $(OBJDIR)/search.o \
820 $(OBJDIR)/setup.o \
821 $(OBJDIR)/sha1.o \
822 $(OBJDIR)/sha1hard.o \
823 $(OBJDIR)/sha3.o \
824 $(OBJDIR)/shun.o \
825 $(OBJDIR)/sitemap.o \
826 $(OBJDIR)/skins.o \
827 $(OBJDIR)/sqlcmd.o \
828 $(OBJDIR)/stash.o \
@@ -1095,10 +1104,11 @@
1104 $(OBJDIR)/fshell_.c:$(OBJDIR)/fshell.h \
1105 $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \
1106 $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \
1107 $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \
1108 $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \
1109 $(OBJDIR)/hname_.c:$(OBJDIR)/hname.h \
1110 $(OBJDIR)/http_.c:$(OBJDIR)/http.h \
1111 $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \
1112 $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h \
1113 $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h \
1114 $(OBJDIR)/import_.c:$(OBJDIR)/import.h \
@@ -1145,10 +1155,12 @@
1155 $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h \
1156 $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h \
1157 $(OBJDIR)/search_.c:$(OBJDIR)/search.h \
1158 $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h \
1159 $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h \
1160 $(OBJDIR)/sha1hard_.c:$(OBJDIR)/sha1hard.h \
1161 $(OBJDIR)/sha3_.c:$(OBJDIR)/sha3.h \
1162 $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h \
1163 $(OBJDIR)/sitemap_.c:$(OBJDIR)/sitemap.h \
1164 $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h \
1165 $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h \
1166 $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h \
@@ -1498,10 +1510,18 @@
1510
1511 $(OBJDIR)/gzip.o: $(OBJDIR)/gzip_.c $(OBJDIR)/gzip.h $(SRCDIR)/config.h
1512 $(XTCC) -o $(OBJDIR)/gzip.o -c $(OBJDIR)/gzip_.c
1513
1514 $(OBJDIR)/gzip.h: $(OBJDIR)/headers
1515
1516 $(OBJDIR)/hname_.c: $(SRCDIR)/hname.c $(TRANSLATE)
1517 $(TRANSLATE) $(SRCDIR)/hname.c >$@
1518
1519 $(OBJDIR)/hname.o: $(OBJDIR)/hname_.c $(OBJDIR)/hname.h $(SRCDIR)/config.h
1520 $(XTCC) -o $(OBJDIR)/hname.o -c $(OBJDIR)/hname_.c
1521
1522 $(OBJDIR)/hname.h: $(OBJDIR)/headers
1523
1524 $(OBJDIR)/http_.c: $(SRCDIR)/http.c $(TRANSLATE)
1525 $(TRANSLATE) $(SRCDIR)/http.c >$@
1526
1527 $(OBJDIR)/http.o: $(OBJDIR)/http_.c $(OBJDIR)/http.h $(SRCDIR)/config.h
@@ -1898,10 +1918,26 @@
1918
1919 $(OBJDIR)/sha1.o: $(OBJDIR)/sha1_.c $(OBJDIR)/sha1.h $(SRCDIR)/config.h
1920 $(XTCC) -o $(OBJDIR)/sha1.o -c $(OBJDIR)/sha1_.c
1921
1922 $(OBJDIR)/sha1.h: $(OBJDIR)/headers
1923
1924 $(OBJDIR)/sha1hard_.c: $(SRCDIR)/sha1hard.c $(TRANSLATE)
1925 $(TRANSLATE) $(SRCDIR)/sha1hard.c >$@
1926
1927 $(OBJDIR)/sha1hard.o: $(OBJDIR)/sha1hard_.c $(OBJDIR)/sha1hard.h $(SRCDIR)/config.h
1928 $(XTCC) -o $(OBJDIR)/sha1hard.o -c $(OBJDIR)/sha1hard_.c
1929
1930 $(OBJDIR)/sha1hard.h: $(OBJDIR)/headers
1931
1932 $(OBJDIR)/sha3_.c: $(SRCDIR)/sha3.c $(TRANSLATE)
1933 $(TRANSLATE) $(SRCDIR)/sha3.c >$@
1934
1935 $(OBJDIR)/sha3.o: $(OBJDIR)/sha3_.c $(OBJDIR)/sha3.h $(SRCDIR)/config.h
1936 $(XTCC) -o $(OBJDIR)/sha3.o -c $(OBJDIR)/sha3_.c
1937
1938 $(OBJDIR)/sha3.h: $(OBJDIR)/headers
1939
1940 $(OBJDIR)/shun_.c: $(SRCDIR)/shun.c $(TRANSLATE)
1941 $(TRANSLATE) $(SRCDIR)/shun.c >$@
1942
1943 $(OBJDIR)/shun.o: $(OBJDIR)/shun_.c $(OBJDIR)/shun.h $(SRCDIR)/config.h
1944
--- www/branching.wiki
+++ www/branching.wiki
@@ -10,14 +10,14 @@
1010
Figure 1
1111
</td></tr></table>
1212
1313
Each circle represents a check-in. For the sake of clarity, the check-ins
1414
are given small consecutive numbers. In a real system, of course, the
15
-check-in numbers would be 40-character SHA1 hashes since it is not possible
15
+check-in numbers would be long hexadecimal hashes since it is not possible
1616
to allocate collision-free sequential numbers in a distributed system.
1717
But as sequential numbers are easier to read, we will substitute them for
18
-the 40-character SHA1 hashes in this document.
18
+the long hashes in this document.
1919
2020
The arrows in figure 1 show the evolution of a project. The initial
2121
check-in is 1. Check-in 2 is derived from 1. In other words, check-in 2
2222
was created by making edits to check-in 1 and then committing those edits.
2323
We say that 2 is a <i>child</i> of 1
@@ -193,11 +193,11 @@
193193
figure 5, that initial check-in is check-in 1. The <b>branch</b> tag
194194
tells (by its value) what branch the check-in is a member of.
195195
The default branch is called "trunk." All tags that begin with "<b>sym-</b>"
196196
are symbolic name tags. When a symbolic name tag is attached to a
197197
check-in, that allows you to refer to that check-in by its symbolic
198
-name rather than by its 40-character SHA1 hash name. When a symbolic name
198
+name rather than by its hexadecimal hash name. When a symbolic name
199199
tag propagates (as does the <b>sym-trunk</b> tag) then referring to that
200200
name is the same as referring to the most recent check-in with that name.
201201
Thus the two tags on check-in 1 cause all descendants to be in the
202202
"trunk" branch and to have the symbolic name "trunk."
203203
204204
--- www/branching.wiki
+++ www/branching.wiki
@@ -10,14 +10,14 @@
10 Figure 1
11 </td></tr></table>
12
13 Each circle represents a check-in. For the sake of clarity, the check-ins
14 are given small consecutive numbers. In a real system, of course, the
15 check-in numbers would be 40-character SHA1 hashes since it is not possible
16 to allocate collision-free sequential numbers in a distributed system.
17 But as sequential numbers are easier to read, we will substitute them for
18 the 40-character SHA1 hashes in this document.
19
20 The arrows in figure 1 show the evolution of a project. The initial
21 check-in is 1. Check-in 2 is derived from 1. In other words, check-in 2
22 was created by making edits to check-in 1 and then committing those edits.
23 We say that 2 is a <i>child</i> of 1
@@ -193,11 +193,11 @@
193 figure 5, that initial check-in is check-in 1. The <b>branch</b> tag
194 tells (by its value) what branch the check-in is a member of.
195 The default branch is called "trunk." All tags that begin with "<b>sym-</b>"
196 are symbolic name tags. When a symbolic name tag is attached to a
197 check-in, that allows you to refer to that check-in by its symbolic
198 name rather than by its 40-character SHA1 hash name. When a symbolic name
199 tag propagates (as does the <b>sym-trunk</b> tag) then referring to that
200 name is the same as referring to the most recent check-in with that name.
201 Thus the two tags on check-in 1 cause all descendants to be in the
202 "trunk" branch and to have the symbolic name "trunk."
203
204
--- www/branching.wiki
+++ www/branching.wiki
@@ -10,14 +10,14 @@
10 Figure 1
11 </td></tr></table>
12
13 Each circle represents a check-in. For the sake of clarity, the check-ins
14 are given small consecutive numbers. In a real system, of course, the
15 check-in numbers would be long hexadecimal hashes since it is not possible
16 to allocate collision-free sequential numbers in a distributed system.
17 But as sequential numbers are easier to read, we will substitute them for
18 the long hashes in this document.
19
20 The arrows in figure 1 show the evolution of a project. The initial
21 check-in is 1. Check-in 2 is derived from 1. In other words, check-in 2
22 was created by making edits to check-in 1 and then committing those edits.
23 We say that 2 is a <i>child</i> of 1
@@ -193,11 +193,11 @@
193 figure 5, that initial check-in is check-in 1. The <b>branch</b> tag
194 tells (by its value) what branch the check-in is a member of.
195 The default branch is called "trunk." All tags that begin with "<b>sym-</b>"
196 are symbolic name tags. When a symbolic name tag is attached to a
197 check-in, that allows you to refer to that check-in by its symbolic
198 name rather than by its hexadecimal hash name. When a symbolic name
199 tag propagates (as does the <b>sym-trunk</b> tag) then referring to that
200 name is the same as referring to the most recent check-in with that name.
201 Thus the two tags on check-in 1 cause all descendants to be in the
202 "trunk" branch and to have the symbolic name "trunk."
203
204
--- www/checkin_names.wiki
+++ www/checkin_names.wiki
@@ -4,11 +4,11 @@
44
<tr><td>
55
<h3>Executive Summary</h3>
66
<p>A check-in can be identified using any of the following
77
names:
88
<ul>
9
-<li> SHA1 hash prefix
9
+<li> Cryptographic hash prefix
1010
<li> Tag or branchname
1111
<li> Timestamp: <i>YYYY-MM-DD HH:MM:SS</i>
1212
<li> <i>tag-name</i> <big><b>:</b></big> <i>timestamp</i>
1313
<li> <b>root :</b> <i>branchname</i>
1414
<li> Special names:
@@ -44,19 +44,19 @@
4444
Fossil provides a variety of ways to specify a check-in. This
4545
document describes the various methods.
4646
4747
<h2>Canonical Check-in Name</h2>
4848
49
-The canonical name of a check-in is the SHA1 hash of its
50
-[./fileformat.wiki#manifest | manifest] expressed as a 40-character
49
+The canonical name of a check-in is the hash of its
50
+[./fileformat.wiki#manifest | manifest] expressed as a 40-or-more character
5151
lowercase hexadecimal number. For example:
5252
5353
<blockquote><pre>
5454
fossil info e5a734a19a9826973e1d073b49dc2a16aa2308f9
5555
</pre></blockquote>
5656
57
-The full 40-character SHA1 hash is unwieldy to remember and type, though,
57
+The full 40+ character hash is unwieldy to remember and type, though,
5858
so Fossil also accepts a unique prefix of the hash, using any combination
5959
of upper and lower case letters, as long as the prefix is at least 4
6060
characters long. Hence the following commands all
6161
accomplish the same thing as the above:
6262
6363
--- www/checkin_names.wiki
+++ www/checkin_names.wiki
@@ -4,11 +4,11 @@
4 <tr><td>
5 <h3>Executive Summary</h3>
6 <p>A check-in can be identified using any of the following
7 names:
8 <ul>
9 <li> SHA1 hash prefix
10 <li> Tag or branchname
11 <li> Timestamp: <i>YYYY-MM-DD HH:MM:SS</i>
12 <li> <i>tag-name</i> <big><b>:</b></big> <i>timestamp</i>
13 <li> <b>root :</b> <i>branchname</i>
14 <li> Special names:
@@ -44,19 +44,19 @@
44 Fossil provides a variety of ways to specify a check-in. This
45 document describes the various methods.
46
47 <h2>Canonical Check-in Name</h2>
48
49 The canonical name of a check-in is the SHA1 hash of its
50 [./fileformat.wiki#manifest | manifest] expressed as a 40-character
51 lowercase hexadecimal number. For example:
52
53 <blockquote><pre>
54 fossil info e5a734a19a9826973e1d073b49dc2a16aa2308f9
55 </pre></blockquote>
56
57 The full 40-character SHA1 hash is unwieldy to remember and type, though,
58 so Fossil also accepts a unique prefix of the hash, using any combination
59 of upper and lower case letters, as long as the prefix is at least 4
60 characters long. Hence the following commands all
61 accomplish the same thing as the above:
62
63
--- www/checkin_names.wiki
+++ www/checkin_names.wiki
@@ -4,11 +4,11 @@
4 <tr><td>
5 <h3>Executive Summary</h3>
6 <p>A check-in can be identified using any of the following
7 names:
8 <ul>
9 <li> Cryptographic hash prefix
10 <li> Tag or branchname
11 <li> Timestamp: <i>YYYY-MM-DD HH:MM:SS</i>
12 <li> <i>tag-name</i> <big><b>:</b></big> <i>timestamp</i>
13 <li> <b>root :</b> <i>branchname</i>
14 <li> Special names:
@@ -44,19 +44,19 @@
44 Fossil provides a variety of ways to specify a check-in. This
45 document describes the various methods.
46
47 <h2>Canonical Check-in Name</h2>
48
49 The canonical name of a check-in is the hash of its
50 [./fileformat.wiki#manifest | manifest] expressed as a 40-or-more character
51 lowercase hexadecimal number. For example:
52
53 <blockquote><pre>
54 fossil info e5a734a19a9826973e1d073b49dc2a16aa2308f9
55 </pre></blockquote>
56
57 The full 40+ character hash is unwieldy to remember and type, though,
58 so Fossil also accepts a unique prefix of the hash, using any combination
59 of upper and lower case letters, as long as the prefix is at least 4
60 characters long. Hence the following commands all
61 accomplish the same thing as the above:
62
63
--- www/customskin.md
+++ www/customskin.md
@@ -177,11 +177,11 @@
177177
178178
* **csrf_token** - A token used to prevent cross-site request forgery.
179179
180180
* **release_version** - The release version of Fossil. Ex: "1.31"
181181
182
- * **manifest_version** - A prefix on the SHA1 check-in hash of the
182
+ * **manifest_version** - A prefix on the check-in hash of the
183183
specific version of fossil that is running. Ex: "\[47bb6432a1\]"
184184
185185
* **manifest_date** - The date of the source-code check-in for the
186186
version of fossil that is running.
187187
188188
--- www/customskin.md
+++ www/customskin.md
@@ -177,11 +177,11 @@
177
178 * **csrf_token** - A token used to prevent cross-site request forgery.
179
180 * **release_version** - The release version of Fossil. Ex: "1.31"
181
182 * **manifest_version** - A prefix on the SHA1 check-in hash of the
183 specific version of fossil that is running. Ex: "\[47bb6432a1\]"
184
185 * **manifest_date** - The date of the source-code check-in for the
186 version of fossil that is running.
187
188
--- www/customskin.md
+++ www/customskin.md
@@ -177,11 +177,11 @@
177
178 * **csrf_token** - A token used to prevent cross-site request forgery.
179
180 * **release_version** - The release version of Fossil. Ex: "1.31"
181
182 * **manifest_version** - A prefix on the check-in hash of the
183 specific version of fossil that is running. Ex: "\[47bb6432a1\]"
184
185 * **manifest_date** - The date of the source-code check-in for the
186 version of fossil that is running.
187
188
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -40,20 +40,15 @@
4040
Each artifact in the repository is named by a hash of its content.
4141
No prefixes, suffixes, or other information is added to an artifact before
4242
the hash is computed. The artifact name is just the (lower-case
4343
hexadecimal) hash of the raw artifact.
4444
45
-Fossil supports multiple hash algorithms including SHA1 and various
46
-lengths of SHA3. Because an artifact can be hashed using multiple algorithms,
47
-a single artifact can have multiple names. Usually, Fossil knows
48
-each artifact by just a single name called the "display name". But it is
49
-possible for Fossil to know an artifact by multiple names from different
50
-hashes. In that case, Fossil uses the display name for output, but continues
51
-to accept the alternative names as command-line arguments or as parameters to
52
-webpage URLs.
53
-
54
-When referring to artifacts in using tty commands or webpage URLs, it is
45
+Fossil currently computes artifact names using either SHA1 or SHA3-256. It
46
+is relatively easy to add new algorithms in the future, but there are no
47
+plans to do so at this time.
48
+
49
+When referring to artifacts in using tty commands or webpage URLs, it is
5550
sufficient to specify a unique prefix for the artifact name. If the input
5651
prefix is not unique, Fossil will show an error. Within a structural
5752
artifact, however, all references to other artifacts must be the complete
5853
hash.
5954
@@ -62,11 +57,11 @@
6257
alternative hash algorithms.
6358
6459
<a name="structural"></a>
6560
<h2>2.0 Structural Artifacts</h2>
6661
67
-A structural artifact is an artifact that has a particular format and
62
+A structural artifact is an artifact with a particular format
6863
that is used to define the relationships between other artifacts in the
6964
repository.
7065
Fossil recognizes the following kinds of structural
7166
artifacts:
7267
7368
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -40,20 +40,15 @@
40 Each artifact in the repository is named by a hash of its content.
41 No prefixes, suffixes, or other information is added to an artifact before
42 the hash is computed. The artifact name is just the (lower-case
43 hexadecimal) hash of the raw artifact.
44
45 Fossil supports multiple hash algorithms including SHA1 and various
46 lengths of SHA3. Because an artifact can be hashed using multiple algorithms,
47 a single artifact can have multiple names. Usually, Fossil knows
48 each artifact by just a single name called the "display name". But it is
49 possible for Fossil to know an artifact by multiple names from different
50 hashes. In that case, Fossil uses the display name for output, but continues
51 to accept the alternative names as command-line arguments or as parameters to
52 webpage URLs.
53
54 When referring to artifacts in using tty commands or webpage URLs, it is
55 sufficient to specify a unique prefix for the artifact name. If the input
56 prefix is not unique, Fossil will show an error. Within a structural
57 artifact, however, all references to other artifacts must be the complete
58 hash.
59
@@ -62,11 +57,11 @@
62 alternative hash algorithms.
63
64 <a name="structural"></a>
65 <h2>2.0 Structural Artifacts</h2>
66
67 A structural artifact is an artifact that has a particular format and
68 that is used to define the relationships between other artifacts in the
69 repository.
70 Fossil recognizes the following kinds of structural
71 artifacts:
72
73
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -40,20 +40,15 @@
40 Each artifact in the repository is named by a hash of its content.
41 No prefixes, suffixes, or other information is added to an artifact before
42 the hash is computed. The artifact name is just the (lower-case
43 hexadecimal) hash of the raw artifact.
44
45 Fossil currently computes artifact names using either SHA1 or SHA3-256. It
46 is relatively easy to add new algorithms in the future, but there are no
47 plans to do so at this time.
48
49 When referring to artifacts in using tty commands or webpage URLs, it is
 
 
 
 
 
50 sufficient to specify a unique prefix for the artifact name. If the input
51 prefix is not unique, Fossil will show an error. Within a structural
52 artifact, however, all references to other artifacts must be the complete
53 hash.
54
@@ -62,11 +57,11 @@
57 alternative hash algorithms.
58
59 <a name="structural"></a>
60 <h2>2.0 Structural Artifacts</h2>
61
62 A structural artifact is an artifact with a particular format
63 that is used to define the relationships between other artifacts in the
64 repository.
65 Fossil recognizes the following kinds of structural
66 artifacts:
67
68
--- www/fossil-v-git.wiki
+++ www/fossil-v-git.wiki
@@ -67,11 +67,12 @@
6767
6868
<h3>3.2 Database</h3>
6969
7070
The baseline data structures for Fossil and Git are the same (modulo
7171
formatting details). Both systems store check-ins as immutable
72
-objects referencing their immediate ancestors and named by their SHA1 hash.
72
+objects referencing their immediate ancestors and named by a
73
+cryptographic hash of the check-in content.
7374
7475
The difference is that Git stores its objects as individual files
7576
in the ".git" folder or compressed into
7677
bespoke "pack-files", whereas Fossil stores its objects in a
7778
relational ([https://www.sqlite.org/|SQLite]) database file. To put it
7879
--- www/fossil-v-git.wiki
+++ www/fossil-v-git.wiki
@@ -67,11 +67,12 @@
67
68 <h3>3.2 Database</h3>
69
70 The baseline data structures for Fossil and Git are the same (modulo
71 formatting details). Both systems store check-ins as immutable
72 objects referencing their immediate ancestors and named by their SHA1 hash.
 
73
74 The difference is that Git stores its objects as individual files
75 in the ".git" folder or compressed into
76 bespoke "pack-files", whereas Fossil stores its objects in a
77 relational ([https://www.sqlite.org/|SQLite]) database file. To put it
78
--- www/fossil-v-git.wiki
+++ www/fossil-v-git.wiki
@@ -67,11 +67,12 @@
67
68 <h3>3.2 Database</h3>
69
70 The baseline data structures for Fossil and Git are the same (modulo
71 formatting details). Both systems store check-ins as immutable
72 objects referencing their immediate ancestors and named by a
73 cryptographic hash of the check-in content.
74
75 The difference is that Git stores its objects as individual files
76 in the ".git" folder or compressed into
77 bespoke "pack-files", whereas Fossil stores its objects in a
78 relational ([https://www.sqlite.org/|SQLite]) database file. To put it
79
--- www/mkdownload.tcl
+++ www/mkdownload.tcl
@@ -37,12 +37,12 @@
3737
set avers($version) 1
3838
}
3939
}
4040
close $in
4141
42
+set vdate(2.0) 2017-03-03
4243
set vdate(1.37) 2017-01-15
43
-set vdate(1.36) 2016-10-24
4444
4545
# Do all versions from newest to oldest
4646
#
4747
foreach vers [lsort -decr -real [array names avers]] {
4848
# set hr "../timeline?c=version-$vers;y=ci"
@@ -57,11 +57,11 @@
5757
puts $out "</b></center>"
5858
puts $out "</td></tr>"
5959
puts $out "<tr>"
6060
6161
foreach {prefix img desc} {
62
- fossil-linux-x86 linux.gif {Linux 3.x x86}
62
+ fossil-linux linux.gif {Linux 3.x x64}
6363
fossil-macosx mac.gif {Mac 10.x x86}
6464
fossil-openbsd-x86 openbsd.gif {OpenBSD 5.x x86}
6565
fossil-w32 win32.gif {Windows}
6666
fossil-src src.gif {Source Tarball}
6767
} {
6868
--- www/mkdownload.tcl
+++ www/mkdownload.tcl
@@ -37,12 +37,12 @@
37 set avers($version) 1
38 }
39 }
40 close $in
41
 
42 set vdate(1.37) 2017-01-15
43 set vdate(1.36) 2016-10-24
44
45 # Do all versions from newest to oldest
46 #
47 foreach vers [lsort -decr -real [array names avers]] {
48 # set hr "../timeline?c=version-$vers;y=ci"
@@ -57,11 +57,11 @@
57 puts $out "</b></center>"
58 puts $out "</td></tr>"
59 puts $out "<tr>"
60
61 foreach {prefix img desc} {
62 fossil-linux-x86 linux.gif {Linux 3.x x86}
63 fossil-macosx mac.gif {Mac 10.x x86}
64 fossil-openbsd-x86 openbsd.gif {OpenBSD 5.x x86}
65 fossil-w32 win32.gif {Windows}
66 fossil-src src.gif {Source Tarball}
67 } {
68
--- www/mkdownload.tcl
+++ www/mkdownload.tcl
@@ -37,12 +37,12 @@
37 set avers($version) 1
38 }
39 }
40 close $in
41
42 set vdate(2.0) 2017-03-03
43 set vdate(1.37) 2017-01-15
 
44
45 # Do all versions from newest to oldest
46 #
47 foreach vers [lsort -decr -real [array names avers]] {
48 # set hr "../timeline?c=version-$vers;y=ci"
@@ -57,11 +57,11 @@
57 puts $out "</b></center>"
58 puts $out "</td></tr>"
59 puts $out "<tr>"
60
61 foreach {prefix img desc} {
62 fossil-linux linux.gif {Linux 3.x x64}
63 fossil-macosx mac.gif {Mac 10.x x86}
64 fossil-openbsd-x86 openbsd.gif {OpenBSD 5.x x86}
65 fossil-w32 win32.gif {Windows}
66 fossil-src src.gif {Source Tarball}
67 } {
68
+7 -6
--- www/pop.wiki
+++ www/pop.wiki
@@ -25,17 +25,18 @@
2525
The global state represents the content of the project.
2626
The local state identifies the authorized users and
2727
access policies for a particular repository.</p></li>
2828
2929
<li><p>The global state of a repository is an unordered
30
-collection of artifacts. Each artifact is named by
31
-its SHA1 hash encoded in lowercase hexadecimal.
30
+collection of artifacts. Each artifact is named by a
31
+cryptographic hash (SHA1 or SHA3-256) encoded in
32
+lowercase hexadecimal.
3233
In many contexts, the name can be
3334
abbreviated to a unique prefix. A five- or six-character
3435
prefix usually suffices to uniquely identify a file.</p></li>
3536
36
-<li><p>Because artifacts are named by their SHA1 hash, all artifacts
37
+<li><p>Because artifacts are named by a cryptographic hash, all artifacts
3738
are immutable. Any change to the content of an artifact also
3839
changes the hash that forms the artifacts name, thus
3940
creating a new artifact. Both the old original version of the
4041
artifact and the new change are preserved under different names.</p></li>
4142
@@ -42,16 +43,16 @@
4243
<li><p>It is theoretically possible for two artifacts with different
4344
content to share the same hash. But finding two such
4445
artifacts is so incredibly difficult and unlikely that we
4546
consider it to be an impossibility.</p></li>
4647
47
-<li><p>The signature of an artifact is the SHA1 hash of the
48
+<li><p>The signature of an artifact is the cryptographic hash of the
4849
artifact itself, exactly as it would appear in a disk file. No prefix
4950
or meta-information about the artifact is added before computing
5051
the hash. So you can
51
-always find the SHA1 signature of a file by using the
52
-"sha1sum" command-line utility.</p></li>
52
+always find the signature of a file by using the
53
+"sha1sum" or "sha3sum" or similar command-line utilities.</p></li>
5354
5455
<li><p>The artifacts that comprise the global state of a repository
5556
are the complete global state of that repository. The SQLite
5657
database that holds the repository contains additional information
5758
about linkages between artifacts, but all of that added information
5859
--- www/pop.wiki
+++ www/pop.wiki
@@ -25,17 +25,18 @@
25 The global state represents the content of the project.
26 The local state identifies the authorized users and
27 access policies for a particular repository.</p></li>
28
29 <li><p>The global state of a repository is an unordered
30 collection of artifacts. Each artifact is named by
31 its SHA1 hash encoded in lowercase hexadecimal.
 
32 In many contexts, the name can be
33 abbreviated to a unique prefix. A five- or six-character
34 prefix usually suffices to uniquely identify a file.</p></li>
35
36 <li><p>Because artifacts are named by their SHA1 hash, all artifacts
37 are immutable. Any change to the content of an artifact also
38 changes the hash that forms the artifacts name, thus
39 creating a new artifact. Both the old original version of the
40 artifact and the new change are preserved under different names.</p></li>
41
@@ -42,16 +43,16 @@
42 <li><p>It is theoretically possible for two artifacts with different
43 content to share the same hash. But finding two such
44 artifacts is so incredibly difficult and unlikely that we
45 consider it to be an impossibility.</p></li>
46
47 <li><p>The signature of an artifact is the SHA1 hash of the
48 artifact itself, exactly as it would appear in a disk file. No prefix
49 or meta-information about the artifact is added before computing
50 the hash. So you can
51 always find the SHA1 signature of a file by using the
52 "sha1sum" command-line utility.</p></li>
53
54 <li><p>The artifacts that comprise the global state of a repository
55 are the complete global state of that repository. The SQLite
56 database that holds the repository contains additional information
57 about linkages between artifacts, but all of that added information
58
--- www/pop.wiki
+++ www/pop.wiki
@@ -25,17 +25,18 @@
25 The global state represents the content of the project.
26 The local state identifies the authorized users and
27 access policies for a particular repository.</p></li>
28
29 <li><p>The global state of a repository is an unordered
30 collection of artifacts. Each artifact is named by a
31 cryptographic hash (SHA1 or SHA3-256) encoded in
32 lowercase hexadecimal.
33 In many contexts, the name can be
34 abbreviated to a unique prefix. A five- or six-character
35 prefix usually suffices to uniquely identify a file.</p></li>
36
37 <li><p>Because artifacts are named by a cryptographic hash, all artifacts
38 are immutable. Any change to the content of an artifact also
39 changes the hash that forms the artifacts name, thus
40 creating a new artifact. Both the old original version of the
41 artifact and the new change are preserved under different names.</p></li>
42
@@ -42,16 +43,16 @@
43 <li><p>It is theoretically possible for two artifacts with different
44 content to share the same hash. But finding two such
45 artifacts is so incredibly difficult and unlikely that we
46 consider it to be an impossibility.</p></li>
47
48 <li><p>The signature of an artifact is the cryptographic hash of the
49 artifact itself, exactly as it would appear in a disk file. No prefix
50 or meta-information about the artifact is added before computing
51 the hash. So you can
52 always find the signature of a file by using the
53 "sha1sum" or "sha3sum" or similar command-line utilities.</p></li>
54
55 <li><p>The artifacts that comprise the global state of a repository
56 are the complete global state of that repository. The SQLite
57 database that holds the repository contains additional information
58 about linkages between artifacts, but all of that added information
59
--- www/selfcheck.wiki
+++ www/selfcheck.wiki
@@ -51,14 +51,14 @@
5151
commit. So during the course of check-in (or other repository
5252
operation) many different files
5353
in the repository might be modified. Some files are simply
5454
compressed. Other files are delta encoded and then compressed.
5555
While all this is going on, fossil makes a record of every file
56
-that is encoded and the SHA1 hash of the original content of that
56
+and the SHA1 or SHA3-256 hash of the original content of that
5757
file. Then just before transaction commit, fossil re-extracts
58
-the original content of all files that were written, computes
59
-the SHA1 checksum again, and verifies that the checksums match.
58
+the original content of all files that were written, recomputes
59
+the hash, and verifies that the recomputed hash still matches.
6060
If anything does not match up, an error
6161
message is printed and the transaction rolls back.
6262
6363
So, in other words, fossil always checks to make sure it can
6464
re-extract a file before it commits a change to that file.
@@ -73,12 +73,12 @@
7373
and of all other files in the manifest. Prior to any check-in
7474
commit, these checksums are verified to ensure that the check-in
7575
agrees exactly with what is on disk. Similarly,
7676
the repository checksum is verified after a checkout to make
7777
sure that the entire repository was checked out correctly.
78
-Note that these added checks use a different hash (MD5 instead
79
-of SHA1) in order to avoid common-mode failures in the hash
78
+Note that these added checks use a different hash algorithm (MD5)
79
+in order to avoid common-mode failures in the hash
8080
algorithm implementation.
8181
8282
8383
<h2>Checksums On Control Artifacts And Deltas</h2>
8484
8585
--- www/selfcheck.wiki
+++ www/selfcheck.wiki
@@ -51,14 +51,14 @@
51 commit. So during the course of check-in (or other repository
52 operation) many different files
53 in the repository might be modified. Some files are simply
54 compressed. Other files are delta encoded and then compressed.
55 While all this is going on, fossil makes a record of every file
56 that is encoded and the SHA1 hash of the original content of that
57 file. Then just before transaction commit, fossil re-extracts
58 the original content of all files that were written, computes
59 the SHA1 checksum again, and verifies that the checksums match.
60 If anything does not match up, an error
61 message is printed and the transaction rolls back.
62
63 So, in other words, fossil always checks to make sure it can
64 re-extract a file before it commits a change to that file.
@@ -73,12 +73,12 @@
73 and of all other files in the manifest. Prior to any check-in
74 commit, these checksums are verified to ensure that the check-in
75 agrees exactly with what is on disk. Similarly,
76 the repository checksum is verified after a checkout to make
77 sure that the entire repository was checked out correctly.
78 Note that these added checks use a different hash (MD5 instead
79 of SHA1) in order to avoid common-mode failures in the hash
80 algorithm implementation.
81
82
83 <h2>Checksums On Control Artifacts And Deltas</h2>
84
85
--- www/selfcheck.wiki
+++ www/selfcheck.wiki
@@ -51,14 +51,14 @@
51 commit. So during the course of check-in (or other repository
52 operation) many different files
53 in the repository might be modified. Some files are simply
54 compressed. Other files are delta encoded and then compressed.
55 While all this is going on, fossil makes a record of every file
56 and the SHA1 or SHA3-256 hash of the original content of that
57 file. Then just before transaction commit, fossil re-extracts
58 the original content of all files that were written, recomputes
59 the hash, and verifies that the recomputed hash still matches.
60 If anything does not match up, an error
61 message is printed and the transaction rolls back.
62
63 So, in other words, fossil always checks to make sure it can
64 re-extract a file before it commits a change to that file.
@@ -73,12 +73,12 @@
73 and of all other files in the manifest. Prior to any check-in
74 commit, these checksums are verified to ensure that the check-in
75 agrees exactly with what is on disk. Similarly,
76 the repository checksum is verified after a checkout to make
77 sure that the entire repository was checked out correctly.
78 Note that these added checks use a different hash algorithm (MD5)
79 in order to avoid common-mode failures in the hash
80 algorithm implementation.
81
82
83 <h2>Checksums On Control Artifacts And Deltas</h2>
84
85
--- www/shunning.wiki
+++ www/shunning.wiki
@@ -23,11 +23,11 @@
2323
<h2>Shunning</h2>
2424
2525
Fossil provides a mechanism called "shunning" for removing content from
2626
a repository.
2727
28
-Every Fossil repository maintains a list of the SHA1 hash names of
28
+Every Fossil repository maintains a list of the hash names of
2929
"shunned" artifacts.
3030
Fossil will refuse to push or pull any shunned artifact.
3131
Furthermore, all shunned artifacts (but not the shunning list
3232
itself) are removed from the
3333
repository whenever the repository is reconstructed using the
3434
--- www/shunning.wiki
+++ www/shunning.wiki
@@ -23,11 +23,11 @@
23 <h2>Shunning</h2>
24
25 Fossil provides a mechanism called "shunning" for removing content from
26 a repository.
27
28 Every Fossil repository maintains a list of the SHA1 hash names of
29 "shunned" artifacts.
30 Fossil will refuse to push or pull any shunned artifact.
31 Furthermore, all shunned artifacts (but not the shunning list
32 itself) are removed from the
33 repository whenever the repository is reconstructed using the
34
--- www/shunning.wiki
+++ www/shunning.wiki
@@ -23,11 +23,11 @@
23 <h2>Shunning</h2>
24
25 Fossil provides a mechanism called "shunning" for removing content from
26 a repository.
27
28 Every Fossil repository maintains a list of the hash names of
29 "shunned" artifacts.
30 Fossil will refuse to push or pull any shunned artifact.
31 Furthermore, all shunned artifacts (but not the shunning list
32 itself) are removed from the
33 repository whenever the repository is reconstructed using the
34
+14 -14
--- www/sync.wiki
+++ www/sync.wiki
@@ -4,23 +4,23 @@
44
content between two Fossil repositories.</p>
55
66
<h2>1.0 Overview</h2>
77
88
<p>The global state of a fossil repository consists of an unordered
9
-collection of artifacts. Each artifact is identified by its SHA1 hash
10
-expressed as a 40-character lower-case hexadecimal string.
9
+collection of artifacts. Each artifact is identified by a cryptographic
10
+hash of its content, expressed as a lower-case hexadecimal string.
1111
Synchronization is the process of sharing artifacts between
1212
servers so that all servers have copies of all artifacts. Because
1313
artifacts are unordered, the order in which artifacts are received
14
-at a server is inconsequential. It is assumed that the SHA1 hashes
15
-of artifacts are unique - that every artifact has a different SHA1 hash.
14
+at a server is inconsequential. It is assumed that the hash names
15
+of artifacts are unique - that every artifact has a different hash.
1616
To a first approximation, synchronization proceeds by sharing lists
17
-SHA1 hashes of available artifacts, then sharing those artifacts that
18
-are not found on one side or the other of the connection. In practice,
19
-a repository might contain millions of artifacts. The list of
20
-SHA1 hashes for this many artifacts can be large. So optimizations are
21
-employed that usually reduce the number of SHA1 hashes that need to be
17
+hash values for available artifacts, then sharing the content of artifacts
18
+whose names are missing from one side or the other of the connection.
19
+In practice, a repository might contain millions of artifacts. The list of
20
+hash names for this many artifacts can be large. So optimizations are
21
+employed that usually reduce the number of hashes that need to be
2222
shared to a few hundred.</p>
2323
2424
<p>Each repository also has local state. The local state determines
2525
the web-page formatting preferences, authorized users, ticket formats,
2626
and similar information that varies from one repository to another.
@@ -198,11 +198,11 @@
198198
terminates the file card.
199199
</p>
200200
201201
<p>The first argument of a file card is the ID of the artifact that
202202
is being transferred. The artifact ID is the lower-case hexadecimal
203
-representation of the SHA1 hash of the artifact.
203
+representation of the name hash for the artifact.
204204
The last argument of the file card is the number of bytes of
205205
payload that immediately follow the file card. If the file
206206
card has only two arguments, that means the payload is the
207207
complete content of the artifact. If the file card has three
208208
arguments, then the payload is a delta and second argument is
@@ -231,11 +231,11 @@
231231
<b>cfile</b> <i>artifact-id delta-artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
232232
</blockquote>
233233
234234
<p>The first argument of the cfile card is the ID of the artifact that
235235
is being transferred. The artifact ID is the lower-case hexadecimal
236
-representation of the SHA1 hash of the artifact. The second argument of
236
+representation of the name hash for the artifact. The second argument of
237237
the cfile card is the original size in bytes of the artifact. The last
238238
argument of the cfile card is the number of compressed bytes of payload
239239
that immediately follow the cfile card. If the cfile card has only
240240
three arguments, that means the payload is the complete content of the
241241
artifact. If the cfile card has four arguments, then the payload is a
@@ -271,11 +271,11 @@
271271
<b>uvfile</b> <i>name mtime hash size flags</i> <b>\n</b> <i>content</i>
272272
</blockquote>
273273
274274
<p>The <i>name</i> field is the name of the unversioned file. The
275275
<i>mtime</i> is the last modification time of the file in seconds
276
-since 1970. The <i>hash</i> field is the SHA1 hash of the content
276
+since 1970. The <i>hash</i> field is the hash of the content
277277
for the unversioned file, or "<b>-</b>" for deleted content.
278278
The <i>size</i> field is the (uncompressed) size of the content
279279
in bytes. The <i>flags</i> field is an integer which is interpreted
280280
as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281281
the <i>content</i> is to be omitted. The content might be omitted if
@@ -409,12 +409,12 @@
409409
</blockquote>
410410
411411
<p>The <i>name</i> argument is the name of an unversioned file.
412412
The <i>mtime</i> is the last modification time of the unversioned file
413413
in seconds since 1970.
414
-The <i>hash</i> is the SHA1 hash of the unversioned file content, or
415
-"<b>-</b>" if the file has been deleted.
414
+The <i>hash</i> is the SHA1 or SHA3-256 hash of the unversioned file
415
+content, or "<b>-</b>" if the file has been deleted.
416416
The <i>size</i> is the uncompressed size of the file in bytes.
417417
418418
<p>When the server sees a "pragma uv-hash" card for which the hash
419419
does not match, it sends uvigot cards for every unversioned file that it
420420
holds. The client will use this information to figure out which
421421
--- www/sync.wiki
+++ www/sync.wiki
@@ -4,23 +4,23 @@
4 content between two Fossil repositories.</p>
5
6 <h2>1.0 Overview</h2>
7
8 <p>The global state of a fossil repository consists of an unordered
9 collection of artifacts. Each artifact is identified by its SHA1 hash
10 expressed as a 40-character lower-case hexadecimal string.
11 Synchronization is the process of sharing artifacts between
12 servers so that all servers have copies of all artifacts. Because
13 artifacts are unordered, the order in which artifacts are received
14 at a server is inconsequential. It is assumed that the SHA1 hashes
15 of artifacts are unique - that every artifact has a different SHA1 hash.
16 To a first approximation, synchronization proceeds by sharing lists
17 SHA1 hashes of available artifacts, then sharing those artifacts that
18 are not found on one side or the other of the connection. In practice,
19 a repository might contain millions of artifacts. The list of
20 SHA1 hashes for this many artifacts can be large. So optimizations are
21 employed that usually reduce the number of SHA1 hashes that need to be
22 shared to a few hundred.</p>
23
24 <p>Each repository also has local state. The local state determines
25 the web-page formatting preferences, authorized users, ticket formats,
26 and similar information that varies from one repository to another.
@@ -198,11 +198,11 @@
198 terminates the file card.
199 </p>
200
201 <p>The first argument of a file card is the ID of the artifact that
202 is being transferred. The artifact ID is the lower-case hexadecimal
203 representation of the SHA1 hash of the artifact.
204 The last argument of the file card is the number of bytes of
205 payload that immediately follow the file card. If the file
206 card has only two arguments, that means the payload is the
207 complete content of the artifact. If the file card has three
208 arguments, then the payload is a delta and second argument is
@@ -231,11 +231,11 @@
231 <b>cfile</b> <i>artifact-id delta-artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
232 </blockquote>
233
234 <p>The first argument of the cfile card is the ID of the artifact that
235 is being transferred. The artifact ID is the lower-case hexadecimal
236 representation of the SHA1 hash of the artifact. The second argument of
237 the cfile card is the original size in bytes of the artifact. The last
238 argument of the cfile card is the number of compressed bytes of payload
239 that immediately follow the cfile card. If the cfile card has only
240 three arguments, that means the payload is the complete content of the
241 artifact. If the cfile card has four arguments, then the payload is a
@@ -271,11 +271,11 @@
271 <b>uvfile</b> <i>name mtime hash size flags</i> <b>\n</b> <i>content</i>
272 </blockquote>
273
274 <p>The <i>name</i> field is the name of the unversioned file. The
275 <i>mtime</i> is the last modification time of the file in seconds
276 since 1970. The <i>hash</i> field is the SHA1 hash of the content
277 for the unversioned file, or "<b>-</b>" for deleted content.
278 The <i>size</i> field is the (uncompressed) size of the content
279 in bytes. The <i>flags</i> field is an integer which is interpreted
280 as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281 the <i>content</i> is to be omitted. The content might be omitted if
@@ -409,12 +409,12 @@
409 </blockquote>
410
411 <p>The <i>name</i> argument is the name of an unversioned file.
412 The <i>mtime</i> is the last modification time of the unversioned file
413 in seconds since 1970.
414 The <i>hash</i> is the SHA1 hash of the unversioned file content, or
415 "<b>-</b>" if the file has been deleted.
416 The <i>size</i> is the uncompressed size of the file in bytes.
417
418 <p>When the server sees a "pragma uv-hash" card for which the hash
419 does not match, it sends uvigot cards for every unversioned file that it
420 holds. The client will use this information to figure out which
421
--- www/sync.wiki
+++ www/sync.wiki
@@ -4,23 +4,23 @@
4 content between two Fossil repositories.</p>
5
6 <h2>1.0 Overview</h2>
7
8 <p>The global state of a fossil repository consists of an unordered
9 collection of artifacts. Each artifact is identified by a cryptographic
10 hash of its content, expressed as a lower-case hexadecimal string.
11 Synchronization is the process of sharing artifacts between
12 servers so that all servers have copies of all artifacts. Because
13 artifacts are unordered, the order in which artifacts are received
14 at a server is inconsequential. It is assumed that the hash names
15 of artifacts are unique - that every artifact has a different hash.
16 To a first approximation, synchronization proceeds by sharing lists
17 hash values for available artifacts, then sharing the content of artifacts
18 whose names are missing from one side or the other of the connection.
19 In practice, a repository might contain millions of artifacts. The list of
20 hash names for this many artifacts can be large. So optimizations are
21 employed that usually reduce the number of hashes that need to be
22 shared to a few hundred.</p>
23
24 <p>Each repository also has local state. The local state determines
25 the web-page formatting preferences, authorized users, ticket formats,
26 and similar information that varies from one repository to another.
@@ -198,11 +198,11 @@
198 terminates the file card.
199 </p>
200
201 <p>The first argument of a file card is the ID of the artifact that
202 is being transferred. The artifact ID is the lower-case hexadecimal
203 representation of the name hash for the artifact.
204 The last argument of the file card is the number of bytes of
205 payload that immediately follow the file card. If the file
206 card has only two arguments, that means the payload is the
207 complete content of the artifact. If the file card has three
208 arguments, then the payload is a delta and second argument is
@@ -231,11 +231,11 @@
231 <b>cfile</b> <i>artifact-id delta-artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
232 </blockquote>
233
234 <p>The first argument of the cfile card is the ID of the artifact that
235 is being transferred. The artifact ID is the lower-case hexadecimal
236 representation of the name hash for the artifact. The second argument of
237 the cfile card is the original size in bytes of the artifact. The last
238 argument of the cfile card is the number of compressed bytes of payload
239 that immediately follow the cfile card. If the cfile card has only
240 three arguments, that means the payload is the complete content of the
241 artifact. If the cfile card has four arguments, then the payload is a
@@ -271,11 +271,11 @@
271 <b>uvfile</b> <i>name mtime hash size flags</i> <b>\n</b> <i>content</i>
272 </blockquote>
273
274 <p>The <i>name</i> field is the name of the unversioned file. The
275 <i>mtime</i> is the last modification time of the file in seconds
276 since 1970. The <i>hash</i> field is the hash of the content
277 for the unversioned file, or "<b>-</b>" for deleted content.
278 The <i>size</i> field is the (uncompressed) size of the content
279 in bytes. The <i>flags</i> field is an integer which is interpreted
280 as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281 the <i>content</i> is to be omitted. The content might be omitted if
@@ -409,12 +409,12 @@
409 </blockquote>
410
411 <p>The <i>name</i> argument is the name of an unversioned file.
412 The <i>mtime</i> is the last modification time of the unversioned file
413 in seconds since 1970.
414 The <i>hash</i> is the SHA1 or SHA3-256 hash of the unversioned file
415 content, or "<b>-</b>" if the file has been deleted.
416 The <i>size</i> is the uncompressed size of the file in bytes.
417
418 <p>When the server sees a "pragma uv-hash" card for which the hash
419 does not match, it sends uvigot cards for every unversioned file that it
420 holds. The client will use this information to figure out which
421
--- www/tech_overview.wiki
+++ www/tech_overview.wiki
@@ -173,11 +173,12 @@
173173
the [/help/deconstruct | fossil deconstruct]
174174
command. Individual artifacts can be extracted using the
175175
[/help/artifact | fossil artifact] command.
176176
When accessing the repository database using raw SQL and the
177177
[/help/sqlite3 | fossil sql] command, the extension function
178
-"<tt>content()</tt>" with a single argument which is the SHA1 hash
178
+"<tt>content()</tt>" with a single argument which is the SHA1 or
179
+SHA3-256 hash
179180
of an artifact will return the complete undeleted and uncompressed
180181
content of that artifact.
181182
182183
Going the other way, the [/help/reconstruct | fossil reconstruct]
183184
command will scan a directory hierarchy and add all files found to
@@ -278,11 +279,11 @@
278279
project - is intended to be an append-only database. In other words,
279280
new artifacts can be added but artifacts can never be removed. But
280281
it sometimes happens that inappropriate content is mistakenly or
281282
maliciously added to a repository. The only way to get rid of
282283
the undesired content is to [./shunning.wiki | "shun"] it.
283
-The "shun" table in the repository database records the SHA1 hash of
284
+The "shun" table in the repository database records the hash values for
284285
all shunned artifacts.
285286
286287
The shun table can be pushed or pulled using
287288
the [/help/config | fossil config] command with the "shun" AREA argument.
288289
The shun table is also copied during a [/help/clone | clone].
289290
--- www/tech_overview.wiki
+++ www/tech_overview.wiki
@@ -173,11 +173,12 @@
173 the [/help/deconstruct | fossil deconstruct]
174 command. Individual artifacts can be extracted using the
175 [/help/artifact | fossil artifact] command.
176 When accessing the repository database using raw SQL and the
177 [/help/sqlite3 | fossil sql] command, the extension function
178 "<tt>content()</tt>" with a single argument which is the SHA1 hash
 
179 of an artifact will return the complete undeleted and uncompressed
180 content of that artifact.
181
182 Going the other way, the [/help/reconstruct | fossil reconstruct]
183 command will scan a directory hierarchy and add all files found to
@@ -278,11 +279,11 @@
278 project - is intended to be an append-only database. In other words,
279 new artifacts can be added but artifacts can never be removed. But
280 it sometimes happens that inappropriate content is mistakenly or
281 maliciously added to a repository. The only way to get rid of
282 the undesired content is to [./shunning.wiki | "shun"] it.
283 The "shun" table in the repository database records the SHA1 hash of
284 all shunned artifacts.
285
286 The shun table can be pushed or pulled using
287 the [/help/config | fossil config] command with the "shun" AREA argument.
288 The shun table is also copied during a [/help/clone | clone].
289
--- www/tech_overview.wiki
+++ www/tech_overview.wiki
@@ -173,11 +173,12 @@
173 the [/help/deconstruct | fossil deconstruct]
174 command. Individual artifacts can be extracted using the
175 [/help/artifact | fossil artifact] command.
176 When accessing the repository database using raw SQL and the
177 [/help/sqlite3 | fossil sql] command, the extension function
178 "<tt>content()</tt>" with a single argument which is the SHA1 or
179 SHA3-256 hash
180 of an artifact will return the complete undeleted and uncompressed
181 content of that artifact.
182
183 Going the other way, the [/help/reconstruct | fossil reconstruct]
184 command will scan a directory hierarchy and add all files found to
@@ -278,11 +279,11 @@
279 project - is intended to be an append-only database. In other words,
280 new artifacts can be added but artifacts can never be removed. But
281 it sometimes happens that inappropriate content is mistakenly or
282 maliciously added to a repository. The only way to get rid of
283 the undesired content is to [./shunning.wiki | "shun"] it.
284 The "shun" table in the repository database records the hash values for
285 all shunned artifacts.
286
287 The shun table can be pushed or pulled using
288 the [/help/config | fossil config] command with the "shun" AREA argument.
289 The shun table is also copied during a [/help/clone | clone].
290
--- www/theory1.wiki
+++ www/theory1.wiki
@@ -38,11 +38,12 @@
3838
been checked into the Fossil repository. Call these "content artifacts".
3939
Other artifacts, known as
4040
"control artifacts", contain ASCII text in a particular format that
4141
defines relationships between other artifacts, such as which
4242
content artifacts that go together to form a particular version of the
43
-project. Each artifact is named by its SHA1 hash and is thus immutable.
43
+project. Each artifact is named by its SHA1 or SHA3-256 hash and is
44
+thus immutable.
4445
Artifacts can be added to the database but not removed (if we ignore
4546
the exceptional case of [./shunning.wiki | shunning].) Repositories
4647
synchronize by computing the union of their artifact sets. SQL and
4748
relation theory play no role in any of this.
4849
4950
--- www/theory1.wiki
+++ www/theory1.wiki
@@ -38,11 +38,12 @@
38 been checked into the Fossil repository. Call these "content artifacts".
39 Other artifacts, known as
40 "control artifacts", contain ASCII text in a particular format that
41 defines relationships between other artifacts, such as which
42 content artifacts that go together to form a particular version of the
43 project. Each artifact is named by its SHA1 hash and is thus immutable.
 
44 Artifacts can be added to the database but not removed (if we ignore
45 the exceptional case of [./shunning.wiki | shunning].) Repositories
46 synchronize by computing the union of their artifact sets. SQL and
47 relation theory play no role in any of this.
48
49
--- www/theory1.wiki
+++ www/theory1.wiki
@@ -38,11 +38,12 @@
38 been checked into the Fossil repository. Call these "content artifacts".
39 Other artifacts, known as
40 "control artifacts", contain ASCII text in a particular format that
41 defines relationships between other artifacts, such as which
42 content artifacts that go together to form a particular version of the
43 project. Each artifact is named by its SHA1 or SHA3-256 hash and is
44 thus immutable.
45 Artifacts can be added to the database but not removed (if we ignore
46 the exceptional case of [./shunning.wiki | shunning].) Repositories
47 synchronize by computing the union of their artifact sets. SQL and
48 relation theory play no role in any of this.
49
50
--- www/webpage-ex.md
+++ www/webpage-ex.md
@@ -123,10 +123,10 @@
123123
href='$ROOT/bigbloblist'>Example</a>
124124
The largest objects in the repository.
125125
126126
* <a target='_blank' class='exbtn'
127127
href='$ROOT/hash-collisions'>Example</a>
128
- SHA1 prefix collisions
128
+ Hash prefix collisions
129129
130130
* <a target='_blank' class='exbtn'
131131
href='$ROOT/sitemap'>Example</a>
132132
The "sitemap" containing links to many other pages
133133
--- www/webpage-ex.md
+++ www/webpage-ex.md
@@ -123,10 +123,10 @@
123 href='$ROOT/bigbloblist'>Example</a>
124 The largest objects in the repository.
125
126 * <a target='_blank' class='exbtn'
127 href='$ROOT/hash-collisions'>Example</a>
128 SHA1 prefix collisions
129
130 * <a target='_blank' class='exbtn'
131 href='$ROOT/sitemap'>Example</a>
132 The "sitemap" containing links to many other pages
133
--- www/webpage-ex.md
+++ www/webpage-ex.md
@@ -123,10 +123,10 @@
123 href='$ROOT/bigbloblist'>Example</a>
124 The largest objects in the repository.
125
126 * <a target='_blank' class='exbtn'
127 href='$ROOT/hash-collisions'>Example</a>
128 Hash prefix collisions
129
130 * <a target='_blank' class='exbtn'
131 href='$ROOT/sitemap'>Example</a>
132 The "sitemap" containing links to many other pages
133
--- www/whyusefossil.wiki
+++ www/whyusefossil.wiki
@@ -232,18 +232,19 @@
232232
</ul>
233233
</ul>
234234
<li><p><b>Why version control is important (reprise)</b>
235235
<ol type="A">
236236
<li><p>Every check-in and every individual file has a unique name - its
237
- SHA1 hash. Team members can unambiguously identify any specific
237
+ SHA1 or SHA3-256 hash. Team members can unambiguously identify
238
+ any specific
238239
version of the overall project or any specific version of an
239240
individual file.
240241
<li><p>Any historical version of the whole project or of any individual
241242
file can be easily recreated at any time and by any team member.
242243
<li><p>Accidental changes to files can be detected by recomputing their
243
- SHA1 hash.
244
- <li><p>Files of unknown origin can be identified using their SHA1 hash.
244
+ cryptographic hash.
245
+ <li><p>Files of unknown origin can be identified using their hash.
245246
<li><p>Developers are able to work in parallel, review each others work,
246247
and easily merge their changes together. External revisions to
247248
the baseline can be easily incorporated into the latest changes.
248249
<li><p>Developers can follow experimental lines of development, then
249250
revert back to an earlier stable version if the experiment does
250251
--- www/whyusefossil.wiki
+++ www/whyusefossil.wiki
@@ -232,18 +232,19 @@
232 </ul>
233 </ul>
234 <li><p><b>Why version control is important (reprise)</b>
235 <ol type="A">
236 <li><p>Every check-in and every individual file has a unique name - its
237 SHA1 hash. Team members can unambiguously identify any specific
 
238 version of the overall project or any specific version of an
239 individual file.
240 <li><p>Any historical version of the whole project or of any individual
241 file can be easily recreated at any time and by any team member.
242 <li><p>Accidental changes to files can be detected by recomputing their
243 SHA1 hash.
244 <li><p>Files of unknown origin can be identified using their SHA1 hash.
245 <li><p>Developers are able to work in parallel, review each others work,
246 and easily merge their changes together. External revisions to
247 the baseline can be easily incorporated into the latest changes.
248 <li><p>Developers can follow experimental lines of development, then
249 revert back to an earlier stable version if the experiment does
250
--- www/whyusefossil.wiki
+++ www/whyusefossil.wiki
@@ -232,18 +232,19 @@
232 </ul>
233 </ul>
234 <li><p><b>Why version control is important (reprise)</b>
235 <ol type="A">
236 <li><p>Every check-in and every individual file has a unique name - its
237 SHA1 or SHA3-256 hash. Team members can unambiguously identify
238 any specific
239 version of the overall project or any specific version of an
240 individual file.
241 <li><p>Any historical version of the whole project or of any individual
242 file can be easily recreated at any time and by any team member.
243 <li><p>Accidental changes to files can be detected by recomputing their
244 cryptographic hash.
245 <li><p>Files of unknown origin can be identified using their hash.
246 <li><p>Developers are able to work in parallel, review each others work,
247 and easily merge their changes together. External revisions to
248 the baseline can be easily incorporated into the latest changes.
249 <li><p>Developers can follow experimental lines of development, then
250 revert back to an earlier stable version if the experiment does
251

Keyboard Shortcuts

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