Fossil SCM
Merge enhancements from trunk
Commit
acd3b31f757397e26f53fbed537174ad1bcec639
Parent
32ba35f3b02d67c…
29 files changed
+21
-7
+1
-1
+90
+3
-3
+1
-1
+3
-3
+8
-9
+1
-1
+4
-3
+1
-1
+35
-32
+58
-1
+1
-1
+4
-3
+36
+3
-3
+4
-4
+1
-1
+6
-11
+2
-1
+2
-2
+7
-6
+5
-5
+1
-1
+14
-14
+3
-2
+2
-1
+1
-1
+4
-3
~
src/diffcmd.c
~
src/doc.c
~
src/encode.c
~
src/hname.c
~
src/manifest.c
~
src/sha1.c
~
src/sha1hard.c
~
src/sha3.c
~
src/shell.c
~
src/shun.c
~
src/stash.c
~
src/unversioned.c
~
src/vfile.c
~
src/xfer.c
~
win/Makefile.mingw.mistachkin
~
www/branching.wiki
~
www/checkin_names.wiki
~
www/customskin.md
~
www/fileformat.wiki
~
www/fossil-v-git.wiki
~
www/mkdownload.tcl
~
www/pop.wiki
~
www/selfcheck.wiki
~
www/shunning.wiki
~
www/sync.wiki
~
www/tech_overview.wiki
~
www/theory1.wiki
~
www/webpage-ex.md
~
www/whyusefossil.wiki
+21
-7
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -151,10 +151,13 @@ | ||
| 151 | 151 | /* |
| 152 | 152 | ** Show the difference between two files, one in memory and one on disk. |
| 153 | 153 | ** |
| 154 | 154 | ** The difference is the set of edits needed to transform pFile1 into |
| 155 | 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. | |
| 156 | 159 | ** |
| 157 | 160 | ** Use the internal diff logic if zDiffCmd is NULL. Otherwise call the |
| 158 | 161 | ** command zDiffCmd to do the diffing. |
| 159 | 162 | ** |
| 160 | 163 | ** When using an external diff program, zBinGlob contains the GLOB patterns |
| @@ -167,11 +170,12 @@ | ||
| 167 | 170 | const char *zFile2, /* On disk content to compare to */ |
| 168 | 171 | const char *zName, /* Display name of the file */ |
| 169 | 172 | const char *zDiffCmd, /* Command for comparison */ |
| 170 | 173 | const char *zBinGlob, /* Treat file names matching this as binary */ |
| 171 | 174 | 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 */ | |
| 173 | 177 | ){ |
| 174 | 178 | if( zDiffCmd==0 ){ |
| 175 | 179 | Blob out; /* Diff output text */ |
| 176 | 180 | Blob file2; /* Content of zFile2 */ |
| 177 | 181 | const char *zName2; /* Name of zFile2 for display */ |
| @@ -194,11 +198,15 @@ | ||
| 194 | 198 | if( blob_compare(pFile1, &file2) ){ |
| 195 | 199 | fossil_print("CHANGED %s\n", zName); |
| 196 | 200 | } |
| 197 | 201 | }else{ |
| 198 | 202 | 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 | + } | |
| 200 | 208 | if( blob_size(&out) ){ |
| 201 | 209 | diff_print_filenames(zName, zName2, diffFlags); |
| 202 | 210 | fossil_print("%s\n", blob_str(&out)); |
| 203 | 211 | } |
| 204 | 212 | blob_reset(&out); |
| @@ -252,13 +260,19 @@ | ||
| 252 | 260 | blob_write_to_file(pFile1, blob_str(&nameFile1)); |
| 253 | 261 | |
| 254 | 262 | /* Construct the external diff command */ |
| 255 | 263 | blob_zero(&cmd); |
| 256 | 264 | 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 | + } | |
| 260 | 274 | |
| 261 | 275 | /* Run the external diff command */ |
| 262 | 276 | fossil_system(blob_str(&cmd)); |
| 263 | 277 | |
| 264 | 278 | /* Delete the temporary file and clean up memory used */ |
| @@ -482,11 +496,11 @@ | ||
| 482 | 496 | blob_zero(&content); |
| 483 | 497 | } |
| 484 | 498 | isBin = fIncludeBinary ? 0 : looks_like_binary(&content); |
| 485 | 499 | diff_print_index(zPathname, diffFlags); |
| 486 | 500 | diff_file(&content, isBin, zFullName, zPathname, zDiffCmd, |
| 487 | - zBinGlob, fIncludeBinary, diffFlags); | |
| 501 | + zBinGlob, fIncludeBinary, diffFlags, 0); | |
| 488 | 502 | blob_reset(&content); |
| 489 | 503 | } |
| 490 | 504 | blob_reset(&fname); |
| 491 | 505 | } |
| 492 | 506 | db_finalize(&q); |
| @@ -519,11 +533,11 @@ | ||
| 519 | 533 | const char *zFile = (const char*)db_column_text(&q, 0); |
| 520 | 534 | if( !file_dir_match(pFileDir, zFile) ) continue; |
| 521 | 535 | zFullName = mprintf("%s%s", g.zLocalRoot, zFile); |
| 522 | 536 | db_column_blob(&q, 1, &content); |
| 523 | 537 | diff_file(&content, 0, zFullName, zFile, |
| 524 | - zDiffCmd, zBinGlob, fIncludeBinary, diffFlags); | |
| 538 | + zDiffCmd, zBinGlob, fIncludeBinary, diffFlags, 0); | |
| 525 | 539 | fossil_free(zFullName); |
| 526 | 540 | blob_reset(&content); |
| 527 | 541 | } |
| 528 | 542 | db_finalize(&q); |
| 529 | 543 | } |
| 530 | 544 |
| --- 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 @@ | ||
| 735 | 735 | |
| 736 | 736 | /* Jump here when unable to locate the document */ |
| 737 | 737 | doc_not_found: |
| 738 | 738 | db_end_transaction(0); |
| 739 | 739 | if( isUV && P("name")==0 ){ |
| 740 | - uvstat_page(); | |
| 740 | + uvlist_page(); | |
| 741 | 741 | return; |
| 742 | 742 | } |
| 743 | 743 | cgi_set_status(404, "Not Found"); |
| 744 | 744 | style_header("Not Found"); |
| 745 | 745 | @ <p>Document %h(zOrigName) not found |
| 746 | 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 | 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 @@ | ||
| 336 | 336 | z[j++] = c; |
| 337 | 337 | } |
| 338 | 338 | if( z[j] ) z[j] = 0; |
| 339 | 339 | } |
| 340 | 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 | +} | |
| 341 | 431 | |
| 342 | 432 | /* |
| 343 | 433 | ** The characters used for HTTP base64 encoding. |
| 344 | 434 | */ |
| 345 | 435 | static unsigned char zBase[] = |
| 346 | 436 |
| --- 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 @@ | ||
| 60 | 60 | if( nHash==HNAME_LEN_K256 ) return "SHA3-256"; |
| 61 | 61 | return "?"; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /* |
| 65 | -** Return the integer hash algorithm code number (ex: HNAME_K224) for | |
| 65 | +** Return the integer hash algorithm code number (ex: HNAME_K256) for | |
| 66 | 66 | ** the hash string provided. Or return HNAME_ERROR (0) if the input string |
| 67 | 67 | ** is not a valid artifact hash string. |
| 68 | 68 | */ |
| 69 | 69 | int hname_validate(const char *zHash, int nHash){ |
| 70 | 70 | int id; |
| @@ -82,11 +82,11 @@ | ||
| 82 | 82 | ** Return true if the hash is correct. Return false if the content |
| 83 | 83 | ** does not match the hash. |
| 84 | 84 | ** |
| 85 | 85 | ** Actually, the returned value is one of the hash algorithm constants |
| 86 | 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 | |
| 87 | +** (Examples: HNAME_SHA1 or HNAME_K256). And the return is HNAME_ERROR | |
| 88 | 88 | ** if the hash does not match. |
| 89 | 89 | */ |
| 90 | 90 | int hname_verify_hash(Blob *pContent, const char *zHash, int nHash){ |
| 91 | 91 | int id = HNAME_ERROR; |
| 92 | 92 | switch( nHash ){ |
| @@ -114,11 +114,11 @@ | ||
| 114 | 114 | ** Return true if the hash is correct. Return false if the content |
| 115 | 115 | ** does not match the hash. |
| 116 | 116 | ** |
| 117 | 117 | ** Actually, the returned value is one of the hash algorithm constants |
| 118 | 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 | |
| 119 | +** (Examples: HNAME_SHA1 or HNAME_K256). And the return is HNAME_ERROR | |
| 120 | 120 | ** if the hash does not match. |
| 121 | 121 | */ |
| 122 | 122 | int hname_verify_file_hash(const char *zFile, const char *zHash, int nHash){ |
| 123 | 123 | int id = HNAME_ERROR; |
| 124 | 124 | switch( nHash ){ |
| 125 | 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_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 @@ | ||
| 327 | 327 | ** takes over the input blob and will free it when the |
| 328 | 328 | ** Manifest object is freed. Zeros are inserted into the blob |
| 329 | 329 | ** as string terminators so that blob should not be used again. |
| 330 | 330 | ** |
| 331 | 331 | ** 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 | |
| 333 | 333 | ** object needs to be freed by a subsequent call to manifest_destroy(). |
| 334 | 334 | ** Return NULL if there are syntax errors or if the input blob does |
| 335 | 335 | ** not describe a valid structural artifact. |
| 336 | 336 | ** |
| 337 | 337 | ** This routine is strict about the format of a structural artifacts. |
| 338 | 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 |
| --- 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 @@ | ||
| 54 | 54 | uint32_t m2[80]; |
| 55 | 55 | uint32_t states[80][5]; |
| 56 | 56 | }; |
| 57 | 57 | #endif |
| 58 | 58 | void SHA1DCInit(SHA1_CTX*); |
| 59 | -void SHA1DCUpdate(SHA1_CTX*, const char*, unsigned); | |
| 59 | +void SHA1DCUpdate(SHA1_CTX*, const unsigned char*, unsigned); | |
| 60 | 60 | int SHA1DCFinal(unsigned char[20], SHA1_CTX*); |
| 61 | 61 | |
| 62 | 62 | #define SHA1Context SHA1_CTX |
| 63 | 63 | #define SHA1Init SHA1DCInit |
| 64 | 64 | #define SHA1Update SHA1DCUpdate |
| 65 | 65 | #define SHA1Final SHA1DCFinal |
| 66 | 66 | |
| 67 | 67 | /* |
| 68 | -** SHA1 Implemenatation #2: use the SHA1 algorithm built into SSL | |
| 68 | +** SHA1 Implementation #2: use the SHA1 algorithm built into SSL | |
| 69 | 69 | */ |
| 70 | 70 | #elif defined(FOSSIL_ENABLE_SSL) |
| 71 | 71 | |
| 72 | 72 | # include <openssl/sha.h> |
| 73 | 73 | # define SHA1Context SHA_CTX |
| @@ -74,11 +74,11 @@ | ||
| 74 | 74 | # define SHA1Init SHA1_Init |
| 75 | 75 | # define SHA1Update SHA1_Update |
| 76 | 76 | # define SHA1Final SHA1_Final |
| 77 | 77 | |
| 78 | 78 | /* |
| 79 | -** SHA1 Implemenatation #3: If none of the previous two SHA1 | |
| 79 | +** SHA1 Implementation #3: If none of the previous two SHA1 | |
| 80 | 80 | ** algorithms work, there is this built-in. This built-in was the |
| 81 | 81 | ** original implementation used by Fossil. |
| 82 | 82 | */ |
| 83 | 83 | #else |
| 84 | 84 | /* |
| 85 | 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 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 @@ | ||
| 1 | 1 | /* |
| 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 | |
| 4 | 4 | ** |
| 5 | 5 | ** https://github.com/cr-marcstevens/sha1collisiondetection |
| 6 | 6 | ** |
| 7 | 7 | ** The copy was made on 2017-03-01. Some minor formatting changes |
| 8 | 8 | ** were made but otherwise the code is unchanged. All |
| @@ -26,18 +26,18 @@ | ||
| 26 | 26 | * https://opensource.org/licenses/MIT |
| 27 | 27 | ***/ |
| 28 | 28 | /*************** File: LICENSE.txt ***************/ |
| 29 | 29 | /* |
| 30 | 30 | ** MIT License |
| 31 | -** | |
| 31 | +** | |
| 32 | 32 | ** Copyright (c) 2017: |
| 33 | 33 | ** Marc Stevens |
| 34 | 34 | ** Cryptology Group |
| 35 | 35 | ** Centrum Wiskunde & Informatica |
| 36 | 36 | ** P.O. Box 94079, 1090 GB Amsterdam, Netherlands |
| 37 | 37 | ** [email protected] |
| 38 | -** | |
| 38 | +** | |
| 39 | 39 | ** Dan Shumow |
| 40 | 40 | ** Microsoft Research |
| 41 | 41 | ** [email protected] |
| 42 | 42 | ** |
| 43 | 43 | ** Permission is hereby granted, free of charge, to any person obtaining a copy |
| @@ -44,24 +44,23 @@ | ||
| 44 | 44 | ** of this software and associated documentation files (the "Software"), to deal |
| 45 | 45 | ** in the Software without restriction, including without limitation the rights |
| 46 | 46 | ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 47 | 47 | ** copies of the Software, and to permit persons to whom the Software is |
| 48 | 48 | ** furnished to do so, subject to the following conditions: |
| 49 | -** | |
| 49 | +** | |
| 50 | 50 | ** The above copyright notice and this permission notice shall be included in all |
| 51 | 51 | ** copies or substantial portions of the Software. |
| 52 | -** | |
| 52 | +** | |
| 53 | 53 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 54 | 54 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 55 | 55 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 56 | 56 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 57 | 57 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 58 | 58 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 59 | 59 | ** SOFTWARE. |
| 60 | 60 | */ |
| 61 | 61 | |
| 62 | -#include "config.h" | |
| 63 | 62 | #include <string.h> |
| 64 | 63 | #include <memory.h> |
| 65 | 64 | #include <stdio.h> |
| 66 | 65 | |
| 67 | 66 | #define DVMASKSIZE 1 |
| @@ -1501,11 +1500,11 @@ | ||
| 1501 | 1500 | void SHA1DCSetCallback(SHA1_CTX* ctx, collision_block_callback callback) |
| 1502 | 1501 | { |
| 1503 | 1502 | ctx->callback = callback; |
| 1504 | 1503 | } |
| 1505 | 1504 | |
| 1506 | -void SHA1DCUpdate(SHA1_CTX* ctx, const char* buf, unsigned len) | |
| 1505 | +void SHA1DCUpdate(SHA1_CTX* ctx, const unsigned char* buf, unsigned len) | |
| 1507 | 1506 | { |
| 1508 | 1507 | unsigned left, fill; |
| 1509 | 1508 | if (len == 0) |
| 1510 | 1509 | return; |
| 1511 | 1510 | |
| @@ -1555,11 +1554,11 @@ | ||
| 1555 | 1554 | int SHA1DCFinal(unsigned char output[20], SHA1_CTX *ctx) |
| 1556 | 1555 | { |
| 1557 | 1556 | uint32_t last = ctx->total & 63; |
| 1558 | 1557 | uint32_t padn = (last < 56) ? (56 - last) : (120 - last); |
| 1559 | 1558 | uint64_t total; |
| 1560 | - SHA1DCUpdate(ctx, (const char*)(sha1_padding), padn); | |
| 1559 | + SHA1DCUpdate(ctx, sha1_padding, padn); | |
| 1561 | 1560 | |
| 1562 | 1561 | total = ctx->total - padn; |
| 1563 | 1562 | total <<= 3; |
| 1564 | 1563 | ctx->buffer[56] = (unsigned char)(total >> 56); |
| 1565 | 1564 | ctx->buffer[57] = (unsigned char)(total >> 48); |
| 1566 | 1565 |
| --- 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 @@ | ||
| 43 | 43 | #endif |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | /* |
| 47 | 47 | ** State structure for a SHA3 hash in progress |
| 48 | -*/ | |
| 48 | +*/ | |
| 49 | 49 | typedef struct SHA3Context SHA3Context; |
| 50 | 50 | struct SHA3Context { |
| 51 | 51 | union { |
| 52 | 52 | u64 s[25]; /* Keccak state. 5x5 lines of 64 bits each */ |
| 53 | 53 | unsigned char x[1600]; /* ... or 1600 bytes */ |
| 54 | 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 |
| --- 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 @@ | ||
| 2210 | 2210 | " csv Comma-separated values\n" |
| 2211 | 2211 | " column Left-aligned columns. (See .width)\n" |
| 2212 | 2212 | " html HTML <table> code\n" |
| 2213 | 2213 | " insert SQL insert statements for TABLE\n" |
| 2214 | 2214 | " line One value per line\n" |
| 2215 | - " list Values delimited by .separator strings\n" | |
| 2215 | + " list Values delimited by \"|\"\n" | |
| 2216 | 2216 | " quote Escape answers as for SQL\n" |
| 2217 | 2217 | " tabs Tab-separated values\n" |
| 2218 | 2218 | " tcl TCL list elements\n" |
| 2219 | 2219 | ".nullvalue STRING Use STRING in place of NULL values\n" |
| 2220 | 2220 | ".once FILENAME Output for the next SQL command only to FILENAME\n" |
| @@ -4342,10 +4342,11 @@ | ||
| 4342 | 4342 | int newFlag = 0; /* True to delete file before opening */ |
| 4343 | 4343 | /* Close the existing database */ |
| 4344 | 4344 | session_close_all(p); |
| 4345 | 4345 | sqlite3_close(p->db); |
| 4346 | 4346 | p->db = 0; |
| 4347 | + p->zDbFilename = 0; | |
| 4347 | 4348 | sqlite3_free(p->zFreeOnClose); |
| 4348 | 4349 | p->zFreeOnClose = 0; |
| 4349 | 4350 | /* Check for command-line arguments */ |
| 4350 | 4351 | for(iName=1; iName<nArg && azArg[iName][0]=='-'; iName++){ |
| 4351 | 4352 | const char *z = azArg[iName]; |
| @@ -4612,11 +4613,11 @@ | ||
| 4612 | 4613 | } |
| 4613 | 4614 | }else |
| 4614 | 4615 | |
| 4615 | 4616 | #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE) |
| 4616 | 4617 | if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){ |
| 4617 | - sqlite3SelectTrace = integerValue(azArg[1]); | |
| 4618 | + sqlite3SelectTrace = (int)integerValue(azArg[1]); | |
| 4618 | 4619 | }else |
| 4619 | 4620 | #endif |
| 4620 | 4621 | |
| 4621 | 4622 | #if defined(SQLITE_ENABLE_SESSION) |
| 4622 | 4623 | if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){ |
| @@ -5190,10 +5191,11 @@ | ||
| 5190 | 5191 | azArg[1]); |
| 5191 | 5192 | break; |
| 5192 | 5193 | } |
| 5193 | 5194 | } |
| 5194 | 5195 | }else |
| 5196 | +#endif /* !defined(SQLITE_UNTESTABLE) */ | |
| 5195 | 5197 | |
| 5196 | 5198 | if( c=='t' && n>4 && strncmp(azArg[0], "timeout", n)==0 ){ |
| 5197 | 5199 | open_db(p, 0); |
| 5198 | 5200 | sqlite3_busy_timeout(p->db, nArg>=2 ? (int)integerValue(azArg[1]) : 0); |
| 5199 | 5201 | }else |
| @@ -5226,11 +5228,10 @@ | ||
| 5226 | 5228 | }else{ |
| 5227 | 5229 | sqlite3_trace_v2(p->db, SQLITE_TRACE_STMT, sql_trace_callback,p->traceOut); |
| 5228 | 5230 | } |
| 5229 | 5231 | #endif |
| 5230 | 5232 | }else |
| 5231 | -#endif /* !defined(SQLITE_UNTESTABLE) */ | |
| 5232 | 5233 | |
| 5233 | 5234 | #if SQLITE_USER_AUTHENTICATION |
| 5234 | 5235 | if( c=='u' && strncmp(azArg[0], "user", n)==0 ){ |
| 5235 | 5236 | if( nArg<2 ){ |
| 5236 | 5237 | raw_printf(stderr, "Usage: .user SUBCOMMAND ...\n"); |
| 5237 | 5238 |
| --- 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 @@ | ||
| 173 | 173 | @ 64-character lowercase hexadecimal hash of the artifact content) in the |
| 174 | 174 | @ following box and press the "Shun" button. This will cause the artifacts |
| 175 | 175 | @ to be removed from the repository and will prevent the artifacts from being |
| 176 | 176 | @ readded to the repository by subsequent sync operation.</p> |
| 177 | 177 | @ |
| 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, | |
| 179 | 179 | @ not an abbreviation or a symbolic tag.</p> |
| 180 | 180 | @ |
| 181 | 181 | @ <p>Warning: Shunning should only be used to remove inappropriate content |
| 182 | 182 | @ from the repository. Inappropriate content includes such things as |
| 183 | 183 | @ spam added to Wiki, files that violate copyright or patent agreements, |
| 184 | 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 |
| --- 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 @@ | ||
| 332 | 332 | isBin2 = fIncludeBinary ? 0 : looks_like_binary(&a); |
| 333 | 333 | diff_file_mem(&empty, &a, isBin1, isBin2, zNew, zDiffCmd, |
| 334 | 334 | zBinGlob, fIncludeBinary, diffFlags); |
| 335 | 335 | }else if( isRemoved ){ |
| 336 | 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; | |
| 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; | |
| 353 | 348 | int isOrigLink = file_wd_islink(zOPath); |
| 354 | 349 | 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 | 350 | fossil_print("CHANGED %s\n", zNew); |
| 363 | 351 | if( !isOrigLink != !isLink ){ |
| 364 | 352 | diff_print_index(zNew, diffFlags); |
| 365 | 353 | diff_print_filenames(zOrig, zNew, diffFlags); |
| 366 | 354 | printf(DIFF_CANNOT_COMPUTE_SYMLINK); |
| 367 | 355 | }else{ |
| 368 | - Blob *pBase = fBaseline ? &a : &disk; | |
| 369 | 356 | content_get(rid, &a); |
| 370 | 357 | blob_delta_apply(&a, &delta, &b); |
| 371 | - isBin1 = fIncludeBinary ? 0 : looks_like_binary(pBase); | |
| 358 | + isBin1 = fIncludeBinary ? 0 : looks_like_binary(&a); | |
| 372 | 359 | 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 | + } | |
| 375 | 369 | blob_reset(&a); |
| 376 | 370 | blob_reset(&b); |
| 377 | 371 | } |
| 378 | - if( !fBaseline ) blob_reset(&disk); | |
| 379 | 372 | blob_reset(&delta); |
| 380 | 373 | } |
| 381 | 374 | } |
| 382 | 375 | db_finalize(&q); |
| 383 | 376 | } |
| @@ -433,12 +426,15 @@ | ||
| 433 | 426 | ** |
| 434 | 427 | ** List all changes sets currently stashed. Show information about |
| 435 | 428 | ** individual files in each changeset if -v or --verbose is used. |
| 436 | 429 | ** |
| 437 | 430 | ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS? |
| 431 | +** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS? | |
| 438 | 432 | ** |
| 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. | |
| 440 | 436 | ** |
| 441 | 437 | ** fossil stash pop |
| 442 | 438 | ** fossil stash apply ?STASHID? |
| 443 | 439 | ** |
| 444 | 440 | ** Apply STASHID or the most recently create stash to the current |
| @@ -460,18 +456,20 @@ | ||
| 460 | 456 | ** |
| 461 | 457 | ** fossil stash diff ?STASHID? ?DIFF-OPTIONS? |
| 462 | 458 | ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS? |
| 463 | 459 | ** |
| 464 | 460 | ** 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. | |
| 466 | 463 | ** |
| 467 | 464 | ** SUMMARY: |
| 468 | 465 | ** fossil stash |
| 469 | 466 | ** fossil stash save ?-m|--comment COMMENT? ?FILES...? |
| 470 | 467 | ** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...? |
| 471 | 468 | ** fossil stash list|ls ?-v|--verbose? ?-W|--width <num>? |
| 472 | 469 | ** fossil stash show|cat ?STASHID? ?DIFF-OPTIONS? |
| 470 | +** fossil stash gshow|gcat ?STASHID? ?DIFF-OPTIONS? | |
| 473 | 471 | ** fossil stash pop |
| 474 | 472 | ** fossil stash apply|goto ?STASHID? |
| 475 | 473 | ** fossil stash drop|rm ?STASHID? ?-a|--all? |
| 476 | 474 | ** fossil stash diff ?STASHID? ?DIFF-OPTIONS? |
| 477 | 475 | ** fossil stash gdiff ?STASHID? ?DIFF-OPTIONS? |
| @@ -654,25 +652,30 @@ | ||
| 654 | 652 | undo_finish(); |
| 655 | 653 | }else |
| 656 | 654 | if( memcmp(zCmd, "diff", nCmd)==0 |
| 657 | 655 | || memcmp(zCmd, "gdiff", nCmd)==0 |
| 658 | 656 | || memcmp(zCmd, "show", nCmd)==0 |
| 657 | + || memcmp(zCmd, "gshow", nCmd)==0 | |
| 659 | 658 | || memcmp(zCmd, "cat", nCmd)==0 |
| 659 | + || memcmp(zCmd, "gcat", nCmd)==0 | |
| 660 | 660 | ){ |
| 661 | 661 | const char *zDiffCmd = 0; |
| 662 | 662 | const char *zBinGlob = 0; |
| 663 | 663 | int fIncludeBinary = 0; |
| 664 | - int fBaseline = zCmd[0]=='s' || zCmd[0]=='c'; | |
| 664 | + int fBaseline = 0; | |
| 665 | 665 | u64 diffFlags; |
| 666 | 666 | |
| 667 | + if( strstr(zCmd,"show")!=0 || strstr(zCmd,"cat")!=0 ){ | |
| 668 | + fBaseline = 1; | |
| 669 | + } | |
| 667 | 670 | if( find_option("tk",0,0)!=0 ){ |
| 668 | 671 | db_close(0); |
| 669 | 672 | diff_tk(fBaseline ? "stash show" : "stash diff", 3); |
| 670 | 673 | return; |
| 671 | 674 | } |
| 672 | 675 | 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'); | |
| 674 | 677 | } |
| 675 | 678 | diffFlags = diff_options(); |
| 676 | 679 | if( find_option("verbose","v",0)!=0 ) diffFlags |= DIFF_VERBOSE; |
| 677 | 680 | if( g.argc>4 ) usage(mprintf("%s ?STASHID? ?DIFF-OPTIONS?", zCmd)); |
| 678 | 681 | if( zDiffCmd ){ |
| 679 | 682 |
| --- 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 |
+58
-1
| --- src/unversioned.c | ||
| +++ src/unversioned.c | ||
| @@ -456,11 +456,11 @@ | ||
| 456 | 456 | ** Query parameters: |
| 457 | 457 | ** |
| 458 | 458 | ** byage=1 Order the initial display be decreasing age |
| 459 | 459 | ** showdel=0 Show deleted files |
| 460 | 460 | */ |
| 461 | -void uvstat_page(void){ | |
| 461 | +void uvlist_page(void){ | |
| 462 | 462 | Stmt q; |
| 463 | 463 | sqlite3_int64 iNow; |
| 464 | 464 | sqlite3_int64 iTotalSz = 0; |
| 465 | 465 | int cnt = 0; |
| 466 | 466 | int n = 0; |
| @@ -554,5 +554,62 @@ | ||
| 554 | 554 | }else{ |
| 555 | 555 | @ No unversioned files on this server. |
| 556 | 556 | } |
| 557 | 557 | style_footer(); |
| 558 | 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 | +} | |
| 559 | 616 |
| --- 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 @@ | ||
| 21 | 21 | #include "vfile.h" |
| 22 | 22 | #include <assert.h> |
| 23 | 23 | #include <sys/types.h> |
| 24 | 24 | |
| 25 | 25 | /* |
| 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 | |
| 27 | 27 | ** artifact hash. Find its rid. |
| 28 | 28 | */ |
| 29 | 29 | int fast_uuid_to_rid(const char *zUuid){ |
| 30 | 30 | static Stmt q; |
| 31 | 31 | int rid; |
| 32 | 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 |
| --- 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 @@ | ||
| 496 | 496 | } |
| 497 | 497 | return size; |
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | /* |
| 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 | |
| 502 | 502 | ** has SHA3 content and cannot be synced or cloned. |
| 503 | 503 | */ |
| 504 | 504 | static void xfer_cannot_send_sha3_error(Xfer *pXfer){ |
| 505 | - blob_appendf(pXfer->pOut, | |
| 505 | + blob_appendf(pXfer->pOut, | |
| 506 | 506 | "error Fossil\\sversion\\s2.0\\sor\\slater\\srequired.\n" |
| 507 | 507 | ); |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | |
| @@ -750,11 +750,11 @@ | ||
| 750 | 750 | |
| 751 | 751 | /* |
| 752 | 752 | ** Compute an hash on the tail of pMsg. Verify that it matches the |
| 753 | 753 | ** the hash given in pHash. Return non-zero for an error and 0 on success. |
| 754 | 754 | ** |
| 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 | |
| 756 | 756 | ** the length of the input hash in pHash. |
| 757 | 757 | */ |
| 758 | 758 | static int check_tail_hash(Blob *pHash, Blob *pMsg){ |
| 759 | 759 | Blob tail; |
| 760 | 760 | int rc; |
| @@ -1768,10 +1768,11 @@ | ||
| 1768 | 1768 | memset(&xfer, 0, sizeof(xfer)); |
| 1769 | 1769 | xfer.pIn = &recv; |
| 1770 | 1770 | xfer.pOut = &send; |
| 1771 | 1771 | xfer.mxSend = db_get_int("max-upload", 250000); |
| 1772 | 1772 | xfer.maxTime = -1; |
| 1773 | + xfer.clientVersion = RELEASE_VERSION_NUMBER; | |
| 1773 | 1774 | if( syncFlags & SYNC_PRIVATE ){ |
| 1774 | 1775 | g.perm.Private = 1; |
| 1775 | 1776 | xfer.syncPrivate = 1; |
| 1776 | 1777 | } |
| 1777 | 1778 | |
| 1778 | 1779 |
| --- 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 @@ | ||
| 461 | 461 | $(SRCDIR)/fshell.c \ |
| 462 | 462 | $(SRCDIR)/fusefs.c \ |
| 463 | 463 | $(SRCDIR)/glob.c \ |
| 464 | 464 | $(SRCDIR)/graph.c \ |
| 465 | 465 | $(SRCDIR)/gzip.c \ |
| 466 | + $(SRCDIR)/hname.c \ | |
| 466 | 467 | $(SRCDIR)/http.c \ |
| 467 | 468 | $(SRCDIR)/http_socket.c \ |
| 468 | 469 | $(SRCDIR)/http_ssl.c \ |
| 469 | 470 | $(SRCDIR)/http_transport.c \ |
| 470 | 471 | $(SRCDIR)/import.c \ |
| @@ -511,10 +512,12 @@ | ||
| 511 | 512 | $(SRCDIR)/rss.c \ |
| 512 | 513 | $(SRCDIR)/schema.c \ |
| 513 | 514 | $(SRCDIR)/search.c \ |
| 514 | 515 | $(SRCDIR)/setup.c \ |
| 515 | 516 | $(SRCDIR)/sha1.c \ |
| 517 | + $(SRCDIR)/sha1hard.c \ | |
| 518 | + $(SRCDIR)/sha3.c \ | |
| 516 | 519 | $(SRCDIR)/shun.c \ |
| 517 | 520 | $(SRCDIR)/sitemap.c \ |
| 518 | 521 | $(SRCDIR)/skins.c \ |
| 519 | 522 | $(SRCDIR)/sqlcmd.c \ |
| 520 | 523 | $(SRCDIR)/stash.c \ |
| @@ -636,10 +639,11 @@ | ||
| 636 | 639 | $(OBJDIR)/fshell_.c \ |
| 637 | 640 | $(OBJDIR)/fusefs_.c \ |
| 638 | 641 | $(OBJDIR)/glob_.c \ |
| 639 | 642 | $(OBJDIR)/graph_.c \ |
| 640 | 643 | $(OBJDIR)/gzip_.c \ |
| 644 | + $(OBJDIR)/hname_.c \ | |
| 641 | 645 | $(OBJDIR)/http_.c \ |
| 642 | 646 | $(OBJDIR)/http_socket_.c \ |
| 643 | 647 | $(OBJDIR)/http_ssl_.c \ |
| 644 | 648 | $(OBJDIR)/http_transport_.c \ |
| 645 | 649 | $(OBJDIR)/import_.c \ |
| @@ -686,10 +690,12 @@ | ||
| 686 | 690 | $(OBJDIR)/rss_.c \ |
| 687 | 691 | $(OBJDIR)/schema_.c \ |
| 688 | 692 | $(OBJDIR)/search_.c \ |
| 689 | 693 | $(OBJDIR)/setup_.c \ |
| 690 | 694 | $(OBJDIR)/sha1_.c \ |
| 695 | + $(OBJDIR)/sha1hard_.c \ | |
| 696 | + $(OBJDIR)/sha3_.c \ | |
| 691 | 697 | $(OBJDIR)/shun_.c \ |
| 692 | 698 | $(OBJDIR)/sitemap_.c \ |
| 693 | 699 | $(OBJDIR)/skins_.c \ |
| 694 | 700 | $(OBJDIR)/sqlcmd_.c \ |
| 695 | 701 | $(OBJDIR)/stash_.c \ |
| @@ -760,10 +766,11 @@ | ||
| 760 | 766 | $(OBJDIR)/fshell.o \ |
| 761 | 767 | $(OBJDIR)/fusefs.o \ |
| 762 | 768 | $(OBJDIR)/glob.o \ |
| 763 | 769 | $(OBJDIR)/graph.o \ |
| 764 | 770 | $(OBJDIR)/gzip.o \ |
| 771 | + $(OBJDIR)/hname.o \ | |
| 765 | 772 | $(OBJDIR)/http.o \ |
| 766 | 773 | $(OBJDIR)/http_socket.o \ |
| 767 | 774 | $(OBJDIR)/http_ssl.o \ |
| 768 | 775 | $(OBJDIR)/http_transport.o \ |
| 769 | 776 | $(OBJDIR)/import.o \ |
| @@ -810,10 +817,12 @@ | ||
| 810 | 817 | $(OBJDIR)/rss.o \ |
| 811 | 818 | $(OBJDIR)/schema.o \ |
| 812 | 819 | $(OBJDIR)/search.o \ |
| 813 | 820 | $(OBJDIR)/setup.o \ |
| 814 | 821 | $(OBJDIR)/sha1.o \ |
| 822 | + $(OBJDIR)/sha1hard.o \ | |
| 823 | + $(OBJDIR)/sha3.o \ | |
| 815 | 824 | $(OBJDIR)/shun.o \ |
| 816 | 825 | $(OBJDIR)/sitemap.o \ |
| 817 | 826 | $(OBJDIR)/skins.o \ |
| 818 | 827 | $(OBJDIR)/sqlcmd.o \ |
| 819 | 828 | $(OBJDIR)/stash.o \ |
| @@ -1095,10 +1104,11 @@ | ||
| 1095 | 1104 | $(OBJDIR)/fshell_.c:$(OBJDIR)/fshell.h \ |
| 1096 | 1105 | $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \ |
| 1097 | 1106 | $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \ |
| 1098 | 1107 | $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \ |
| 1099 | 1108 | $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \ |
| 1109 | + $(OBJDIR)/hname_.c:$(OBJDIR)/hname.h \ | |
| 1100 | 1110 | $(OBJDIR)/http_.c:$(OBJDIR)/http.h \ |
| 1101 | 1111 | $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \ |
| 1102 | 1112 | $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h \ |
| 1103 | 1113 | $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h \ |
| 1104 | 1114 | $(OBJDIR)/import_.c:$(OBJDIR)/import.h \ |
| @@ -1145,10 +1155,12 @@ | ||
| 1145 | 1155 | $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h \ |
| 1146 | 1156 | $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h \ |
| 1147 | 1157 | $(OBJDIR)/search_.c:$(OBJDIR)/search.h \ |
| 1148 | 1158 | $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h \ |
| 1149 | 1159 | $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h \ |
| 1160 | + $(OBJDIR)/sha1hard_.c:$(OBJDIR)/sha1hard.h \ | |
| 1161 | + $(OBJDIR)/sha3_.c:$(OBJDIR)/sha3.h \ | |
| 1150 | 1162 | $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h \ |
| 1151 | 1163 | $(OBJDIR)/sitemap_.c:$(OBJDIR)/sitemap.h \ |
| 1152 | 1164 | $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h \ |
| 1153 | 1165 | $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h \ |
| 1154 | 1166 | $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h \ |
| @@ -1498,10 +1510,18 @@ | ||
| 1498 | 1510 | |
| 1499 | 1511 | $(OBJDIR)/gzip.o: $(OBJDIR)/gzip_.c $(OBJDIR)/gzip.h $(SRCDIR)/config.h |
| 1500 | 1512 | $(XTCC) -o $(OBJDIR)/gzip.o -c $(OBJDIR)/gzip_.c |
| 1501 | 1513 | |
| 1502 | 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 | |
| 1503 | 1523 | |
| 1504 | 1524 | $(OBJDIR)/http_.c: $(SRCDIR)/http.c $(TRANSLATE) |
| 1505 | 1525 | $(TRANSLATE) $(SRCDIR)/http.c >$@ |
| 1506 | 1526 | |
| 1507 | 1527 | $(OBJDIR)/http.o: $(OBJDIR)/http_.c $(OBJDIR)/http.h $(SRCDIR)/config.h |
| @@ -1898,10 +1918,26 @@ | ||
| 1898 | 1918 | |
| 1899 | 1919 | $(OBJDIR)/sha1.o: $(OBJDIR)/sha1_.c $(OBJDIR)/sha1.h $(SRCDIR)/config.h |
| 1900 | 1920 | $(XTCC) -o $(OBJDIR)/sha1.o -c $(OBJDIR)/sha1_.c |
| 1901 | 1921 | |
| 1902 | 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 | |
| 1903 | 1939 | |
| 1904 | 1940 | $(OBJDIR)/shun_.c: $(SRCDIR)/shun.c $(TRANSLATE) |
| 1905 | 1941 | $(TRANSLATE) $(SRCDIR)/shun.c >$@ |
| 1906 | 1942 | |
| 1907 | 1943 | $(OBJDIR)/shun.o: $(OBJDIR)/shun_.c $(OBJDIR)/shun.h $(SRCDIR)/config.h |
| 1908 | 1944 |
| --- 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 |
+3
-3
| --- www/branching.wiki | ||
| +++ www/branching.wiki | ||
| @@ -10,14 +10,14 @@ | ||
| 10 | 10 | Figure 1 |
| 11 | 11 | </td></tr></table> |
| 12 | 12 | |
| 13 | 13 | Each circle represents a check-in. For the sake of clarity, the check-ins |
| 14 | 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 | |
| 15 | +check-in numbers would be long hexadecimal hashes since it is not possible | |
| 16 | 16 | to allocate collision-free sequential numbers in a distributed system. |
| 17 | 17 | 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. | |
| 19 | 19 | |
| 20 | 20 | The arrows in figure 1 show the evolution of a project. The initial |
| 21 | 21 | check-in is 1. Check-in 2 is derived from 1. In other words, check-in 2 |
| 22 | 22 | was created by making edits to check-in 1 and then committing those edits. |
| 23 | 23 | We say that 2 is a <i>child</i> of 1 |
| @@ -193,11 +193,11 @@ | ||
| 193 | 193 | figure 5, that initial check-in is check-in 1. The <b>branch</b> tag |
| 194 | 194 | tells (by its value) what branch the check-in is a member of. |
| 195 | 195 | The default branch is called "trunk." All tags that begin with "<b>sym-</b>" |
| 196 | 196 | are symbolic name tags. When a symbolic name tag is attached to a |
| 197 | 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 | |
| 198 | +name rather than by its hexadecimal hash name. When a symbolic name | |
| 199 | 199 | tag propagates (as does the <b>sym-trunk</b> tag) then referring to that |
| 200 | 200 | name is the same as referring to the most recent check-in with that name. |
| 201 | 201 | Thus the two tags on check-in 1 cause all descendants to be in the |
| 202 | 202 | "trunk" branch and to have the symbolic name "trunk." |
| 203 | 203 | |
| 204 | 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 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 |
+4
-4
| --- www/checkin_names.wiki | ||
| +++ www/checkin_names.wiki | ||
| @@ -4,11 +4,11 @@ | ||
| 4 | 4 | <tr><td> |
| 5 | 5 | <h3>Executive Summary</h3> |
| 6 | 6 | <p>A check-in can be identified using any of the following |
| 7 | 7 | names: |
| 8 | 8 | <ul> |
| 9 | -<li> SHA1 hash prefix | |
| 9 | +<li> Cryptographic hash prefix | |
| 10 | 10 | <li> Tag or branchname |
| 11 | 11 | <li> Timestamp: <i>YYYY-MM-DD HH:MM:SS</i> |
| 12 | 12 | <li> <i>tag-name</i> <big><b>:</b></big> <i>timestamp</i> |
| 13 | 13 | <li> <b>root :</b> <i>branchname</i> |
| 14 | 14 | <li> Special names: |
| @@ -44,19 +44,19 @@ | ||
| 44 | 44 | Fossil provides a variety of ways to specify a check-in. This |
| 45 | 45 | document describes the various methods. |
| 46 | 46 | |
| 47 | 47 | <h2>Canonical Check-in Name</h2> |
| 48 | 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 | |
| 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 | 51 | lowercase hexadecimal number. For example: |
| 52 | 52 | |
| 53 | 53 | <blockquote><pre> |
| 54 | 54 | fossil info e5a734a19a9826973e1d073b49dc2a16aa2308f9 |
| 55 | 55 | </pre></blockquote> |
| 56 | 56 | |
| 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, | |
| 58 | 58 | so Fossil also accepts a unique prefix of the hash, using any combination |
| 59 | 59 | of upper and lower case letters, as long as the prefix is at least 4 |
| 60 | 60 | characters long. Hence the following commands all |
| 61 | 61 | accomplish the same thing as the above: |
| 62 | 62 | |
| 63 | 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> 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 |
+1
-1
| --- www/customskin.md | ||
| +++ www/customskin.md | ||
| @@ -177,11 +177,11 @@ | ||
| 177 | 177 | |
| 178 | 178 | * **csrf_token** - A token used to prevent cross-site request forgery. |
| 179 | 179 | |
| 180 | 180 | * **release_version** - The release version of Fossil. Ex: "1.31" |
| 181 | 181 | |
| 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 | |
| 183 | 183 | specific version of fossil that is running. Ex: "\[47bb6432a1\]" |
| 184 | 184 | |
| 185 | 185 | * **manifest_date** - The date of the source-code check-in for the |
| 186 | 186 | version of fossil that is running. |
| 187 | 187 | |
| 188 | 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 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 |
+6
-11
| --- www/fileformat.wiki | ||
| +++ www/fileformat.wiki | ||
| @@ -40,20 +40,15 @@ | ||
| 40 | 40 | Each artifact in the repository is named by a hash of its content. |
| 41 | 41 | No prefixes, suffixes, or other information is added to an artifact before |
| 42 | 42 | the hash is computed. The artifact name is just the (lower-case |
| 43 | 43 | hexadecimal) hash of the raw artifact. |
| 44 | 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 | |
| 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 | |
| 55 | 50 | sufficient to specify a unique prefix for the artifact name. If the input |
| 56 | 51 | prefix is not unique, Fossil will show an error. Within a structural |
| 57 | 52 | artifact, however, all references to other artifacts must be the complete |
| 58 | 53 | hash. |
| 59 | 54 | |
| @@ -62,11 +57,11 @@ | ||
| 62 | 57 | alternative hash algorithms. |
| 63 | 58 | |
| 64 | 59 | <a name="structural"></a> |
| 65 | 60 | <h2>2.0 Structural Artifacts</h2> |
| 66 | 61 | |
| 67 | -A structural artifact is an artifact that has a particular format and | |
| 62 | +A structural artifact is an artifact with a particular format | |
| 68 | 63 | that is used to define the relationships between other artifacts in the |
| 69 | 64 | repository. |
| 70 | 65 | Fossil recognizes the following kinds of structural |
| 71 | 66 | artifacts: |
| 72 | 67 | |
| 73 | 68 |
| --- 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 |
+2
-1
| --- www/fossil-v-git.wiki | ||
| +++ www/fossil-v-git.wiki | ||
| @@ -67,11 +67,12 @@ | ||
| 67 | 67 | |
| 68 | 68 | <h3>3.2 Database</h3> |
| 69 | 69 | |
| 70 | 70 | The baseline data structures for Fossil and Git are the same (modulo |
| 71 | 71 | 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. | |
| 73 | 74 | |
| 74 | 75 | The difference is that Git stores its objects as individual files |
| 75 | 76 | in the ".git" folder or compressed into |
| 76 | 77 | bespoke "pack-files", whereas Fossil stores its objects in a |
| 77 | 78 | relational ([https://www.sqlite.org/|SQLite]) database file. To put it |
| 78 | 79 |
| --- 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 |
+2
-2
| --- www/mkdownload.tcl | ||
| +++ www/mkdownload.tcl | ||
| @@ -37,12 +37,12 @@ | ||
| 37 | 37 | set avers($version) 1 |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | close $in |
| 41 | 41 | |
| 42 | +set vdate(2.0) 2017-03-03 | |
| 42 | 43 | set vdate(1.37) 2017-01-15 |
| 43 | -set vdate(1.36) 2016-10-24 | |
| 44 | 44 | |
| 45 | 45 | # Do all versions from newest to oldest |
| 46 | 46 | # |
| 47 | 47 | foreach vers [lsort -decr -real [array names avers]] { |
| 48 | 48 | # set hr "../timeline?c=version-$vers;y=ci" |
| @@ -57,11 +57,11 @@ | ||
| 57 | 57 | puts $out "</b></center>" |
| 58 | 58 | puts $out "</td></tr>" |
| 59 | 59 | puts $out "<tr>" |
| 60 | 60 | |
| 61 | 61 | foreach {prefix img desc} { |
| 62 | - fossil-linux-x86 linux.gif {Linux 3.x x86} | |
| 62 | + fossil-linux linux.gif {Linux 3.x x64} | |
| 63 | 63 | fossil-macosx mac.gif {Mac 10.x x86} |
| 64 | 64 | fossil-openbsd-x86 openbsd.gif {OpenBSD 5.x x86} |
| 65 | 65 | fossil-w32 win32.gif {Windows} |
| 66 | 66 | fossil-src src.gif {Source Tarball} |
| 67 | 67 | } { |
| 68 | 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(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 @@ | ||
| 25 | 25 | The global state represents the content of the project. |
| 26 | 26 | The local state identifies the authorized users and |
| 27 | 27 | access policies for a particular repository.</p></li> |
| 28 | 28 | |
| 29 | 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. | |
| 30 | +collection of artifacts. Each artifact is named by a | |
| 31 | +cryptographic hash (SHA1 or SHA3-256) encoded in | |
| 32 | +lowercase hexadecimal. | |
| 32 | 33 | In many contexts, the name can be |
| 33 | 34 | abbreviated to a unique prefix. A five- or six-character |
| 34 | 35 | prefix usually suffices to uniquely identify a file.</p></li> |
| 35 | 36 | |
| 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 | |
| 37 | 38 | are immutable. Any change to the content of an artifact also |
| 38 | 39 | changes the hash that forms the artifacts name, thus |
| 39 | 40 | creating a new artifact. Both the old original version of the |
| 40 | 41 | artifact and the new change are preserved under different names.</p></li> |
| 41 | 42 | |
| @@ -42,16 +43,16 @@ | ||
| 42 | 43 | <li><p>It is theoretically possible for two artifacts with different |
| 43 | 44 | content to share the same hash. But finding two such |
| 44 | 45 | artifacts is so incredibly difficult and unlikely that we |
| 45 | 46 | consider it to be an impossibility.</p></li> |
| 46 | 47 | |
| 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 | |
| 48 | 49 | artifact itself, exactly as it would appear in a disk file. No prefix |
| 49 | 50 | or meta-information about the artifact is added before computing |
| 50 | 51 | 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> | |
| 53 | 54 | |
| 54 | 55 | <li><p>The artifacts that comprise the global state of a repository |
| 55 | 56 | are the complete global state of that repository. The SQLite |
| 56 | 57 | database that holds the repository contains additional information |
| 57 | 58 | about linkages between artifacts, but all of that added information |
| 58 | 59 |
| --- 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 |
+5
-5
| --- www/selfcheck.wiki | ||
| +++ www/selfcheck.wiki | ||
| @@ -51,14 +51,14 @@ | ||
| 51 | 51 | commit. So during the course of check-in (or other repository |
| 52 | 52 | operation) many different files |
| 53 | 53 | in the repository might be modified. Some files are simply |
| 54 | 54 | compressed. Other files are delta encoded and then compressed. |
| 55 | 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 | |
| 56 | +and the SHA1 or SHA3-256 hash of the original content of that | |
| 57 | 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. | |
| 58 | +the original content of all files that were written, recomputes | |
| 59 | +the hash, and verifies that the recomputed hash still matches. | |
| 60 | 60 | If anything does not match up, an error |
| 61 | 61 | message is printed and the transaction rolls back. |
| 62 | 62 | |
| 63 | 63 | So, in other words, fossil always checks to make sure it can |
| 64 | 64 | re-extract a file before it commits a change to that file. |
| @@ -73,12 +73,12 @@ | ||
| 73 | 73 | and of all other files in the manifest. Prior to any check-in |
| 74 | 74 | commit, these checksums are verified to ensure that the check-in |
| 75 | 75 | agrees exactly with what is on disk. Similarly, |
| 76 | 76 | the repository checksum is verified after a checkout to make |
| 77 | 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 | |
| 78 | +Note that these added checks use a different hash algorithm (MD5) | |
| 79 | +in order to avoid common-mode failures in the hash | |
| 80 | 80 | algorithm implementation. |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | <h2>Checksums On Control Artifacts And Deltas</h2> |
| 84 | 84 | |
| 85 | 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 | 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 |
+1
-1
| --- www/shunning.wiki | ||
| +++ www/shunning.wiki | ||
| @@ -23,11 +23,11 @@ | ||
| 23 | 23 | <h2>Shunning</h2> |
| 24 | 24 | |
| 25 | 25 | Fossil provides a mechanism called "shunning" for removing content from |
| 26 | 26 | a repository. |
| 27 | 27 | |
| 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 | |
| 29 | 29 | "shunned" artifacts. |
| 30 | 30 | Fossil will refuse to push or pull any shunned artifact. |
| 31 | 31 | Furthermore, all shunned artifacts (but not the shunning list |
| 32 | 32 | itself) are removed from the |
| 33 | 33 | repository whenever the repository is reconstructed using the |
| 34 | 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 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 @@ | ||
| 4 | 4 | content between two Fossil repositories.</p> |
| 5 | 5 | |
| 6 | 6 | <h2>1.0 Overview</h2> |
| 7 | 7 | |
| 8 | 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. | |
| 9 | +collection of artifacts. Each artifact is identified by a cryptographic | |
| 10 | +hash of its content, expressed as a lower-case hexadecimal string. | |
| 11 | 11 | Synchronization is the process of sharing artifacts between |
| 12 | 12 | servers so that all servers have copies of all artifacts. Because |
| 13 | 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. | |
| 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 | 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 | |
| 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 | 22 | shared to a few hundred.</p> |
| 23 | 23 | |
| 24 | 24 | <p>Each repository also has local state. The local state determines |
| 25 | 25 | the web-page formatting preferences, authorized users, ticket formats, |
| 26 | 26 | and similar information that varies from one repository to another. |
| @@ -198,11 +198,11 @@ | ||
| 198 | 198 | terminates the file card. |
| 199 | 199 | </p> |
| 200 | 200 | |
| 201 | 201 | <p>The first argument of a file card is the ID of the artifact that |
| 202 | 202 | 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. | |
| 204 | 204 | The last argument of the file card is the number of bytes of |
| 205 | 205 | payload that immediately follow the file card. If the file |
| 206 | 206 | card has only two arguments, that means the payload is the |
| 207 | 207 | complete content of the artifact. If the file card has three |
| 208 | 208 | arguments, then the payload is a delta and second argument is |
| @@ -231,11 +231,11 @@ | ||
| 231 | 231 | <b>cfile</b> <i>artifact-id delta-artifact-id usize csize</i> <b>\n</b> <i>content</i><br> |
| 232 | 232 | </blockquote> |
| 233 | 233 | |
| 234 | 234 | <p>The first argument of the cfile card is the ID of the artifact that |
| 235 | 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 | |
| 236 | +representation of the name hash for the artifact. The second argument of | |
| 237 | 237 | the cfile card is the original size in bytes of the artifact. The last |
| 238 | 238 | argument of the cfile card is the number of compressed bytes of payload |
| 239 | 239 | that immediately follow the cfile card. If the cfile card has only |
| 240 | 240 | three arguments, that means the payload is the complete content of the |
| 241 | 241 | artifact. If the cfile card has four arguments, then the payload is a |
| @@ -271,11 +271,11 @@ | ||
| 271 | 271 | <b>uvfile</b> <i>name mtime hash size flags</i> <b>\n</b> <i>content</i> |
| 272 | 272 | </blockquote> |
| 273 | 273 | |
| 274 | 274 | <p>The <i>name</i> field is the name of the unversioned file. The |
| 275 | 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 | |
| 276 | +since 1970. The <i>hash</i> field is the hash of the content | |
| 277 | 277 | for the unversioned file, or "<b>-</b>" for deleted content. |
| 278 | 278 | The <i>size</i> field is the (uncompressed) size of the content |
| 279 | 279 | in bytes. The <i>flags</i> field is an integer which is interpreted |
| 280 | 280 | as an array of bits. The 0x0004 bit of <i>flags</i> indicates that |
| 281 | 281 | the <i>content</i> is to be omitted. The content might be omitted if |
| @@ -409,12 +409,12 @@ | ||
| 409 | 409 | </blockquote> |
| 410 | 410 | |
| 411 | 411 | <p>The <i>name</i> argument is the name of an unversioned file. |
| 412 | 412 | The <i>mtime</i> is the last modification time of the unversioned file |
| 413 | 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. | |
| 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 | 416 | The <i>size</i> is the uncompressed size of the file in bytes. |
| 417 | 417 | |
| 418 | 418 | <p>When the server sees a "pragma uv-hash" card for which the hash |
| 419 | 419 | does not match, it sends uvigot cards for every unversioned file that it |
| 420 | 420 | holds. The client will use this information to figure out which |
| 421 | 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 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 |
+3
-2
| --- www/tech_overview.wiki | ||
| +++ www/tech_overview.wiki | ||
| @@ -173,11 +173,12 @@ | ||
| 173 | 173 | the [/help/deconstruct | fossil deconstruct] |
| 174 | 174 | command. Individual artifacts can be extracted using the |
| 175 | 175 | [/help/artifact | fossil artifact] command. |
| 176 | 176 | When accessing the repository database using raw SQL and the |
| 177 | 177 | [/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 | |
| 179 | 180 | of an artifact will return the complete undeleted and uncompressed |
| 180 | 181 | content of that artifact. |
| 181 | 182 | |
| 182 | 183 | Going the other way, the [/help/reconstruct | fossil reconstruct] |
| 183 | 184 | command will scan a directory hierarchy and add all files found to |
| @@ -278,11 +279,11 @@ | ||
| 278 | 279 | project - is intended to be an append-only database. In other words, |
| 279 | 280 | new artifacts can be added but artifacts can never be removed. But |
| 280 | 281 | it sometimes happens that inappropriate content is mistakenly or |
| 281 | 282 | maliciously added to a repository. The only way to get rid of |
| 282 | 283 | 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 | |
| 284 | 285 | all shunned artifacts. |
| 285 | 286 | |
| 286 | 287 | The shun table can be pushed or pulled using |
| 287 | 288 | the [/help/config | fossil config] command with the "shun" AREA argument. |
| 288 | 289 | The shun table is also copied during a [/help/clone | clone]. |
| 289 | 290 |
| --- 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 |
+2
-1
| --- www/theory1.wiki | ||
| +++ www/theory1.wiki | ||
| @@ -38,11 +38,12 @@ | ||
| 38 | 38 | been checked into the Fossil repository. Call these "content artifacts". |
| 39 | 39 | Other artifacts, known as |
| 40 | 40 | "control artifacts", contain ASCII text in a particular format that |
| 41 | 41 | defines relationships between other artifacts, such as which |
| 42 | 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. | |
| 43 | +project. Each artifact is named by its SHA1 or SHA3-256 hash and is | |
| 44 | +thus immutable. | |
| 44 | 45 | Artifacts can be added to the database but not removed (if we ignore |
| 45 | 46 | the exceptional case of [./shunning.wiki | shunning].) Repositories |
| 46 | 47 | synchronize by computing the union of their artifact sets. SQL and |
| 47 | 48 | relation theory play no role in any of this. |
| 48 | 49 | |
| 49 | 50 |
| --- 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 |
+1
-1
| --- www/webpage-ex.md | ||
| +++ www/webpage-ex.md | ||
| @@ -123,10 +123,10 @@ | ||
| 123 | 123 | href='$ROOT/bigbloblist'>Example</a> |
| 124 | 124 | The largest objects in the repository. |
| 125 | 125 | |
| 126 | 126 | * <a target='_blank' class='exbtn' |
| 127 | 127 | href='$ROOT/hash-collisions'>Example</a> |
| 128 | - SHA1 prefix collisions | |
| 128 | + Hash prefix collisions | |
| 129 | 129 | |
| 130 | 130 | * <a target='_blank' class='exbtn' |
| 131 | 131 | href='$ROOT/sitemap'>Example</a> |
| 132 | 132 | The "sitemap" containing links to many other pages |
| 133 | 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 | 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 |
+4
-3
| --- www/whyusefossil.wiki | ||
| +++ www/whyusefossil.wiki | ||
| @@ -232,18 +232,19 @@ | ||
| 232 | 232 | </ul> |
| 233 | 233 | </ul> |
| 234 | 234 | <li><p><b>Why version control is important (reprise)</b> |
| 235 | 235 | <ol type="A"> |
| 236 | 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 | |
| 237 | + SHA1 or SHA3-256 hash. Team members can unambiguously identify | |
| 238 | + any specific | |
| 238 | 239 | version of the overall project or any specific version of an |
| 239 | 240 | individual file. |
| 240 | 241 | <li><p>Any historical version of the whole project or of any individual |
| 241 | 242 | file can be easily recreated at any time and by any team member. |
| 242 | 243 | <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. | |
| 245 | 246 | <li><p>Developers are able to work in parallel, review each others work, |
| 246 | 247 | and easily merge their changes together. External revisions to |
| 247 | 248 | the baseline can be easily incorporated into the latest changes. |
| 248 | 249 | <li><p>Developers can follow experimental lines of development, then |
| 249 | 250 | revert back to an earlier stable version if the experiment does |
| 250 | 251 |
| --- 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 |